android - How to disable all the buttons in the layout for a certain amount of time, java.NullPointerException -
secondscreen.java public class secondscreen extends activity implements view.onclicklistener { //drawables int res[] = new int[] {r.drawable.brownbars,r.drawable.centeredorangedot, r.drawable.dots, r.drawable.greenlines, r.drawable.lightbulb, r.drawable.orangedots, r.drawable.orangelines, r.drawable.tree, r.drawable.yellow, r.drawable.yellowwithred, r.drawable.brownbars,r.drawable.centeredorangedot, r.drawable.dots, r.drawable.greenlines, r.drawable.lightbulb, r.drawable.orangedots, r.drawable.orangelines, r.drawable.tree, r.drawable.yellow, r.drawable.yellowwithred}; int lay1, lay2, shufflecount = 0, gamecount = 0; imagebutton first, second; linearlayout layout; imagebutton b1; imagebutton b2; imagebutton b3; imagebutton b4; imagebutton b5; imagebutton b6; imagebutton b7; imagebutton b8; imagebutton b9; imagebutton b10; imagebutton b11; imagebutton b12; imagebutton b13; imagebutton b14; imagebutton b15; imagebutton b16; imagebutton b17; imagebutton b18; imagebutton b