-
Notifications
You must be signed in to change notification settings - Fork 24
@OnEditorAction
dexafree edited this page Aug 21, 2014
·
4 revisions
This annotation will trigger an event when a TextView receives an action such as pressing ENTER key or a custom action on the keyboard.
The method should be this way:
- public boolean onEditorAction(KeyEvent event)
- public boolean onEditorAction(TextView textView, KeyEvent event)
@OnEditorAction(R.id.edit_text)
public boolean onEditorAction(KeyEvent event) {
Toast.makeText(this, "Editor action received", Toast.LENGTH_SHORT).show();
return false;
}