Home » Android » @Onclick android annotations?

@Onclick android annotations?

Posted by: admin June 15, 2020 Leave a comment

Questions:

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

How to&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!");
}