getAdapterPosition() not returning position of item in RecyclerView

Call getAdapterPosition() in your onClick() method because then at the time of the click you want to know the position of the item. If you check at the time of the creation it will (most of the times) be inaccurate.


Can I get the click event using the viewHolder.mView.setOnClickListener() and then the viewHolder.getAdapterPosition () to get the position. How can I do to get some data from the item I'm clicking, for example the name.

Example complet here:

https://pastebin.com/TuKTchNi