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