@Target(value=METHOD) @Retention(value=CLASS) public @interface OnTextChanged
TextWatcher
on the view for each ID specified.
@OnTextChanged(R.id.example) void onTextChanged(CharSequence text) {
Toast.makeText(this, "Text changed: " + text, LENGTH_SHORT).show();
}
Any number of parameters from onTextChanged
may be used on the method.
To bind to methods other than onTextChanged
, specify a different callback
.
@OnTextChanged(value = R.id.example, callback = BEFORE_TEXT_CHANGED)
void onBeforeTextChanged(CharSequence text {
Toast.makeText(this, "Before text changed: " + text, LENGTH_SHORT).show();
}
TextWatcher
,
Optional
Modifier and Type | Optional Element and Description |
---|---|
OnTextChanged.Callback |
callback
Listener callback to which the method will be bound.
|
int[] |
value
View IDs to which the method will be bound.
|
public abstract int[] value
public abstract OnTextChanged.Callback callback
Copyright © 2013-2015. All Rights Reserved.