I have tried using the code mentioned in the link below to "mass disable" buttons and it works perfectly fine. However the same code does not work for mass enable.
Android: mass enable/disable buttons
Code for Disable (Working)
TableLayout tl = (TableLayout)findViewById(R.id.table1); //
ArrayList<View> touchables = tl.getTouchables();
for(View touchable : touchables){
if( touchable instanceof Button && touchable != btnNewWord )
((Button)touchable).setEnabled(false);
}
CODE for Enable (Not Working)
btnNewWord.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
TableLayout tl = (TableLayout)findViewById(R.id.table1);
ArrayList<View> touchables = tl.getTouchables();
for(View touchable : touchables){
if( touchable != btnNewWord )
((Button)touchable).setEnabled(true);
}