The app has a ListView with multiple-selection enabled, in the UI it works as expected. But when I read the values out using this code:
Log.
This adjustment fixed it for me. Change the getView method so that "int position" is "final int position". Then do this with your checkbox:
((CheckBox) convertView).setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
list.setItemChecked(position, ((CheckBox) buttonView).isChecked());
}
});
Let me elaborate. list is a reference to the listview and in my case the adapter is an inner class in the dialog holding the list.