@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface OnClick
OnClickListener on the view for each ID specified.
@OnClick(R.id.example) void onClick() {
Toast.makeText(this, "Clicked!", Toast.LENGTH_SHORT).show();
}
Any number of parameters from
onClick may be used on the
method.View.OnClickListener| Modifier and Type | Optional Element and Description |
|---|---|
int[] |
value
View IDs to which the method will be bound.
|