-
Notifications
You must be signed in to change notification settings - Fork 24
@OnFocusChanged
dexafree edited this page Aug 21, 2014
·
2 revisions
This annotation will trigger an event when a View receives or loses focus.
The method should be this way:
- public void onFocusChanged(boolean hasFocus)
- public void onFocusChanged(View v, boolean hasFocus)
@OnFocusChanged(R.id.my_view)
public void onFocusChanged(boolean hasFocus) {
Toast.makeText(this, "View has focus: $hasFocus", Toast.LENGTH_SHORT).show();
}