How to avoid duplication of taps in RecyclerVuew?

All kind time of day! Tell me, please, what could be the problem and how to solve it.
RecyclerView adapter in the implementation of viewholders I hung on holder.itemView onClick. The task of a click - clicking on the element RV to a visible layout with detail. And everything is fine, everything works, but if you scroll it will still open elements, and when you come back you may find that open the element that you chose.
Thank you!
April 3rd 20 at 17:46
1 answer
April 3rd 20 at 17:48
RecyclerView preispolitik view and witholder. Therefore, in each onBindViewHolder you have to count on come holder, who has already been used, and, accordingly, the view is also used.
The solution is pressing need to change the dataset(remember that the element is open) and cause notifyItemUpdated. Only in the onBindViewHolder.

Find more questions by tags Android