If you want to disable a set of, or say a particular kind of view.Let's say you want to disable a fixed number of buttons with some particular text of or no text then you can use array of that type and loop through the array elements while disabling the buttons using setEnabled(false) property You can do it on a function call like this:
public void disable(){
for(int i=0;i<9;i++){
if(bt[i].getText().equals("")){//Button Text condition
bt[i].setEnabled(false);
}
}
}