A lighter way to get that thing done smoothly. **TL;DR**Instead of creating a custom ItemClickListener to getAdapterPosition() inside your Activity/Fragment/View and end up creating . Better pass the RecyclerView. using view. inside your ViewHolder and then (…and many other things) from view. i.e. object inside your Activity/Fragment/View. interface multiple Anonymous Classes under the hood for each item ViewHolder setTag() getAdapterPosition() getTag() ViewHolder’s The Problem The Most Popular Way; 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 and as the parameters. view position public interface ItemClickListener { void onItemClick(View view, int position); } Later, we initialize the ItemClickListener instance using the public setter. private ItemClickListener onItemClickListener; ... public void setItemClickListener(ItemClickListener clickListener) { onItemClickListener = clickListener; } OR… by passing the ItemClickListener instance via constructor. <a href="https://medium.com/media/d04f5e386b99fb58feae9904c6138ff4/href">https://medium.com/media/d04f5e386b99fb58feae9904c6138ff4/href</a> And finally we pass our and to the listener. view adapter position <a href="https://medium.com/media/5b7d4e262c63aa6326bc09761f67d7ec/href">https://medium.com/media/5b7d4e262c63aa6326bc09761f67d7ec/href</a> And we know the rest of the part very well. . But there is a problem. Most of the articles out there depict the same thing When we say itemView .setOnClickListener(new View.OnClickListener()… It creates an Anonymous inner class under the hood which implements our ItemClickListener listener. class AnonymousItemClickListener implements ItemClickListener{ @Override public void onItemClick(View view, int position) { } } And we end up creating and initializing multiple Anonymous inner classes under the hood just for a click listener. new AnonymousItemClickListener(){ @Override public void onItemClick(View view, int position) { } }; I used to do the same. Because that is what we get to see all over the internet. A Better Way; The Solution But, recently I got a suggestion from a to implement it in a better and lighter way. Let’s see how (…and many other things) colleague we can get adapter position, item id inside our Activity/Fragment/View. So, instead of creating new custom interface, we will use and initialize it in the way we used to do. View.OnClickListener private View.OnClickListener onItemClickListener; ... public void setItemClickListener(View.OnClickListener clickListener) { onItemClickListener = clickListener; } And we will pass the of via to the listener using . instance ViewHolder itemView setTag() private class MyViewHolder extends RecyclerView.ViewHolder { public MyViewHolder(View itemView) { super(itemView); itemView.setTag(this); } } In this way, we do not need to create Anonymous inner class as we can directly give the reference of onItemClickListener private class MyViewHolder extends RecyclerView.ViewHolder { public MyViewHolder(View itemView) { super(itemView); itemView.setTag(this); itemView.setOnClickListener(onItemClickListener); } } Finally we can get (…and many other things) adapter position and item id inside our Activity/Fragment/View from the ViewHolder instance. RecyclerView.ViewHolder viewHolder = (RecyclerView.ViewHolder) view.getTag(); int position = viewHolder.getAdapterPosition(); // viewHolder.getItemId(); // viewHolder.getItemViewType(); // viewHolder.itemView; Isn’t it?Let me know your views and suggestions about this in the comment section. Simple! Thanks for reading! If you like the article, clap clap clap 👏👏👏 as many times as you can. It inspires me to come up with more beautiful articles.LIKED! Share on Facebook, LinkedIn, WhatsApp. Medium allows up to .Also post a . LIKED SO MUCH! 50 claps Tweet on Twitter About: ,Techy by Birth. Writer by Hobby. Observer by Nature. Unpredictable by Character. Android Developer (Google Certified) by Profession. Rohit Surwase Let’s be the friends on , and LinkedIn Medium , Twitter GitHub .