Android Horizontal Recyclerview Shows Multiple Select On Scroll
I need to select the first item as default selection and selecting a single item on click. But when I scroll and see I could see it selected after every 8th item.it even included t
Solution 1:
That is because you selected the first ViewHolder, but never unselected it.
RecyclerView (as the name suggests) recycles the ViewHolders instead of always making new ones.
If you want to only select the first item, then you should have some sort of state saving, to know what items are selected, and have that state start with the first item as selected.
Then when you bind the ViewHolder, check if the position is selected or not
Post a Comment for "Android Horizontal Recyclerview Shows Multiple Select On Scroll"