Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@Onclick android annotations?

It appears that android studio supports some additional annotations for example @OnClick but I am unable to find any documentation on it.

Does anyone know where I can find such documentation. I found something over at the tools website but it didn't include @OnClick.

Anyone know what this annotation does?

Thanks

like image 783
Martin Avatar asked Jul 07 '15 04:07

Martin


1 Answers

Yes . I think that is Butter Knife injection annotation for onClick

see this link for Butter Knife

example code for onClick

@OnClick(R.id.submit)
public void sayHi(Button button) {
  button.setText("Hello!");
}
like image 168
N J Avatar answered Sep 28 '22 07:09

N J