-
Notifications
You must be signed in to change notification settings - Fork 24
@OnTouch
dexafree edited this page Aug 21, 2014
·
2 revisions
This annotation will trigger an event when a View is touched.
The method should be this way:
- public boolean onTouch(MotionEvent event)
- public boolean onClick(View v, MotionEvent event)
@OnTouch(R.id.button)
public boolean onTouch(MotionEvent event) {
Toast.makeText(this, "Button touched, action: $event.action", Toast.LENGTH_SHORT).show();
return false;
}