Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKartik Gupta
6,454 PointsRecyclerView --------Relation betwwen bindView and Onclick methods ----------
Hi , in this video , we need to get the index of the view which is clicked and this is being obtained from bindview method, so I am not getting how it is happening?
2 Answers
Alok Singh
Courses Plus Student 3,397 PointsThe bind method is taking the position from onBindView method's position parameter for current view to be displayed and bind data to it so when onClick method is called it can also do the same by listening to the correct index positioned view.
Sachin Jayaram
5,461 PointsWhy don't you debug, it will help you understand the code flow really well. Use breakpoints and check how the code flow works.