-
Notifications
You must be signed in to change notification settings - Fork 24
@OnLongClick
dexafree edited this page Aug 21, 2014
·
4 revisions
This annotation will trigger an event when a View (for example, a Button) is long-clicked.
The method should be this way:
- public boolean onLongClick()
- public boolean onLongClick(View v)
Notice it must return a boolean
@OnLongClick(R.id.button)
public boolean onLongClick() {
Toast.makeText(this, "Button long clicked", Toast.LENGTH_SHORT).show();
return true;
}