Вы можете попробовать сделать int [], который содержит все ваши идентификаторы кнопок, а затем перебирать это:
int[] buttonIDs = new int[] {R.id.button1ID, R.id.button2ID, R.id.button3ID, ... }
for(int i=0; i<buttonIDs.length; i++) {
Button b = (Button) findViewById(buttonIDs[i]);
b.setOnClickListener(this);
}