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 seen an answer in one of the questions here saying that he uses '@onclick' inside the 'ViewHolder'. I'm not sure how to implement this exactly. Any ideas?
Thanks!
I have this
ViewHolder
..ok my
R.id.btnCheck
is my id ofLinearLayout
content allViews
write this code in
ViewHolder
classImagine you have a ViewHolder like this.
You can bind events in your adapters getView method for each view in your holder.
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: