New to android development, but not entirely new to Java. Right now my code inside the onCreate() method is quite basic:
Button b1 = (Button) findViewById(R.
Create an array of buttons and do it in a loop:
int[] ids = { R.id.button1, R.id.button2 , ........... }; Button[] buttons = new Buttons[ids.length]; for (int i = 0; i < ids.length; ++i) { buttons[i] = (Button)findViewByIf(ids[i]); buttons[i].setOnClickListener(this); }