How to use SwitchCompat in ListView in Android

520 views Asked by At

I have a ListView, and within each list item I have some TextViews and a switchCompat button. When I check a switch and my onCheckedChangeListener fires, everything works as it should. However, randomly other switches get switched once one is checked. Here is an example.

If I click on the first Switch: 9 is switched. 18 is switched. 27 is switched. 36 is switched. 45 is switched. 54 is switched. Then if I scroll all the way up, none are switched until 5. The next being 12.

Basically... what is going on?

0

There are 0 answers