Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Item Click listener #42

Open
Zapnologica opened this issue Nov 17, 2015 · 1 comment
Open

On Item Click listener #42

Zapnologica opened this issue Nov 17, 2015 · 1 comment
Labels

Comments

@Zapnologica
Copy link

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
Copy link
Contributor

ivacf commented Nov 18, 2015

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

@ivacf ivacf added the question label Nov 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants