Search code examples
androidbutterknife

How to set click listener in butter knife on views found from a certain view?


I have a view instance. From that I am able to bind views using :

Butterknife.findById(view,R.id.textUser)

But I also need to set click listener on this user text textview. How to achieve it using Butterknife??


Solution

  • I think you are talking about @OnClick Annotation.

    Simple usage:

    @OnClick(R.id.textUser)
    void userClicked(TextView textView){
    //do stuff
    }