Csaba Kozák edited this page Mar 16, 2016 · 6 revisions


Since AndroidAnnotations 1.0

The @Click annotation indicates that an activity method must be called when the corresponding view is clicked.

The view id can be set in the annotation parameter, ie @Click(
If the same method handles multiple views, multiple view ids can be given in the following format:

If the view id is not set, the name of the method will be used to guess the view id.

The method may have zero or one parameter, and this parameter can only be a View (the view that was clicked). The method must not be private. Two different methods cannot handle the same view.

Usage example:

void myButtonWasClicked() {

void anotherButton() {

void yetAnotherButton(View clickedView) {

void handlesTwoButtons() {

Since AndroidAnnotations 4.0.0

As of AndroidAnnotations 4.0.0 any subclass of View can be passed to the methods (eg. Button).

Other events

AndroidAnnotations supports other kind of events, and it works exactly as with @Click.

Currently, AndroidAnnotations supports the following events on views:

14/10/2018 The 4.5.1 release is out !

Using AndroidAnnotations


Enjoying AndroidAnnotations

Improving AndroidAnnotations

Extending AndroidAnnotations

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.