-
Notifications
You must be signed in to change notification settings - Fork 24
@OnChecked
dexafree edited this page Aug 21, 2014
·
3 revisions
This annotation will trigger an event when a CompoundButton (for example, a RadioButton) is checked.
The method should be this way:
- public boolean onChecked(boolean checked)
- public boolean onChecked(CompoundButton button, boolean checked)
@OnChecked(R.id.radio_button)
public public boolean onChecked(CompoundButton button, boolean checked) {
Toast.makeText(this, "Button checked: $checked", Toast.LENGTH_SHORT).show();
return false;
}