Edit: Okay, I found a solution. Don\'t know that it\'s the proper solution, but it does work correctly. Added to the code below.
I\'m trying to allow a user to select a
I know you found a solution that works for you, but the cleaner and simpler solution that will probably work most of the time is this (I want to persist all the ids of the elements selected):
(in my ListActivity):
SparseBooleanArray selectedPos = getListView()
.getCheckedItemPositions();
ListAdapter lAdapter = getListAdapter();
List ids = new ArrayList();
for (int i = 0; i < lAdapter.getCount(); i++) {
if (selectedPos.get(i)) {
ids.add(lAdapter.getItemId(i));
}
}