Your row layout needs to be Checkable
for setItemChecked()
to work, in which case Android will manage calling setChecked()
on your Checkable
as the user clicks on the row. You would not need to be setting up your own OnCheckedChangeListener
.
For more, see:
- ListView with CHOICE_MODE_MULTIPLE using CheckedText in a custom view
- Multiple choice list with custom view?
- http://www.marvinlabs.com/2010/10/custom-listview-ability-check-items/
- http://tokudu.com/2010/android-checkable-linear-layout/
- http://alvinalexander.com/java/jwarehouse/apps-for-android/RingsExtended/src/com/example/android/rings_extended/CheckableRelativeLayout.java.shtml