Open Zapnologica opened 9 years ago
How would one pass a onClickListener to the adapter for when the View (parent) or entire ViewHolder is selected.
In your example you only show how to add a onClickListener to a button within the View Holder.
I want to know when a user clicks on an Item in the recyclerView and have the item Passed through to the onclick event.
You should set the click listener on the top level view of the item. Within the ViewHolder you can do getView().setOnClickListener(...)
getView().setOnClickListener(...)
How would one pass a onClickListener to the adapter for when the View (parent) or entire ViewHolder is selected.
In your example you only show how to add a onClickListener to a button within the View Holder.
I want to know when a user clicks on an Item in the recyclerView and have the item Passed through to the onclick event.