@Retention(value=CLASS) @Target(value=METHOD) public @interface CheckedChange
This annotation is intended to be used on methods to receive events defined
by
CompoundButton.OnCheckedChangeListener.onCheckedChanged(android.widget.CompoundButton, boolean)
after the checked state is changed on the targeted CompoundButton or subclass
of CompoundButton.
The annotation value should be one or several R.id.* fields that refers to CompoundButton or subclasses of CompoundButton. If not set, the method name will be used as the R.id.* field name.
The method MAY have multiple parameter:
CompoundButton
parameter to know which view has
targeted this eventboolean
to know the new state of the view.Example :@CheckedChange(R.id.myButton) void checkedChangedOnMyButton(boolean isChecked, CompoundButton button) { // Something Here } @CheckedChange void myButtonCheckedChanged(CompoundButton button) { // Something Here } @CheckedChange({R.id.myButton, R.id.myButton1}) void checkedChangedOnSomeButtons(CompoundButton button, boolean isChecked) { // Something Here } @CheckedChange(R.id.myButton) void checkedChangedOnMyButton() { // Something Here }
Modifier and Type | Optional Element and Description |
---|---|
String[] |
resName
The resource names as strings which refer to the CompoundButtons or
subclasses of CompoundButton.
|
int[] |
value
The R.id.* fields which refer to the CompoundButtons or subclasses of
CompoundButton.
|
public abstract int[] value
public abstract String[] resName
Copyright © 2010-2015. All Rights Reserved.