I\'ve got a ListView with a custom BaseAdapter. The list items contain CheckBoxes that need to represent a property from a database.
I use CheckBox.setOnCheckedChang
Apparently the problem was that, by getting the checkbox using convertView.findViewById(), the onCheckedChangeListeners were still intact if the view was recycled. Calling checkbox.setOnCheckedChangeListener(null) did the trick.
Use a boolean array to store the checked state of each list item, record the changes inside setOnCheckedChangeListener()
, then call setChecked()
after setOnCheckedChangeListener()
.