butterknife @OnClick inside ViewHolder in CustomAdapter

前端 未结 4 2031
耶瑟儿~
耶瑟儿~ 2021-01-13 20:59

I\'m currently learning butterknife, and I need to bind specific @OnClicks on different views generated by my customer adapter. How do I go about with this?

I\'ve se

4条回答
  •  死守一世寂寞
    2021-01-13 21:32

    As @Ugur has suggested you would initiate your ViewHolder using butterknife. You can add an on click listener to a view by doing this as an example for the userName View:

    @OnClick(R.id.user_name)
    public void clickedUserName(SocialEyeTextView userName)
    {
        //Do something with user name
    }
    

提交回复
热议问题