'How to save switch state inside recyclerview?

enter image description here

Here are 4 recyclerview items. I want to save on/off for each respective state. I also thought about Room and sharedPreferences . But I don't know how efficient to store it. (state save) Since I need to save the state for the items in the recyclerview, I tried to save it in the adapter class, but it didn't work.

plz help me :<



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source