ribot / easy-adapter

[DEPRECATED] Easy Adapters library for Android
http://ribot.github.io
Apache License 2.0
421 stars 50 forks source link

On Item Click listener #42

Open Zapnologica opened 8 years ago

Zapnologica commented 8 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.

ivacf commented 8 years ago

You should set the click listener on the top level view of the item. Within the ViewHolder you can do getView().setOnClickListener(...)