In Android development, developers usually have to handle some sort of selection from a list of items. When these items could potentially become many, then a Recycler view is usually a good choice for holding these items because it recycles it’s content and thus improves performance. But since Recycler view recycles it’s items, views that have toggling behaviour(check boxes, switches erc) usually behave unpredictably with Recycler Views this especially happens when developers do not handle the logic of displaying the current state of the view (checked/unchecked)
The common way a developer can go about setting the state of the view is set it to checked when the view is clicked then uncheck it when the view is clicked again by checking the previous state of the view.
I migrated this story to my blog, please continue reading here