In my Android project, I have a ListView with rows containing SwitchCompat items (AppCompat for Switch widget).
ListView
SwitchCompat
Switch
My problem occ
I finally found a solution but seems not really clean:
ViewGroup viewGroup = (ViewGroup) view; // the recycled view viewGroup.removeView(switch); switch.setChecked(states[index]); viewGroup.addView(switch);
If a better solution exists, please share it.