paint-brush
Android RecyclerView onItemClickListener & getAdapterPosition(): A Better Wayby@rohitss
37,125 reads
37,125 reads

Android RecyclerView onItemClickListener & getAdapterPosition(): A Better Way

by Rohit Surwase3mAugust 17th, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

I know you must have already found a way to get onItemClickListener() for your RecyclerView Adapter. But sometimes the way we think is not always the correct or a better way. Whenever anyone tries to find a way to getAdapterPosition() inside their Activity/Fragment/View. He or she comes across the well-known pattern of creating a custom interface with <strong><em>view</em></strong> and <strong><em>position</em></strong> as the parameters.

People Mentioned

Mention Thumbnail
Mention Thumbnail

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Android RecyclerView onItemClickListener & getAdapterPosition(): A Better Way
Rohit Surwase HackerNoon profile picture
Rohit Surwase

Rohit Surwase

@rohitss

L O A D I N G
. . . comments & more!

About Author

Rohit Surwase HackerNoon profile picture
Rohit Surwase@rohitss

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite