public void setImportance(Integer i) { for (CompoundButton b : buttons) { if (b.getTag() == i) { b.setTextSize(24); b.setChecked(true); b.setBackgroundResource(R.drawable.btn_selected); } else { b.setTextSize(16); b.setChecked(false); b.setBackgroundResource(android.R.drawable.btn_default); } } }