@Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { Juice juice = (Juice) buttonView.getTag(); if (juice != null) { juice.available = !juice.available; setJuiceAvailability(juice); } }