How to get Selected items from Multi Select List View

SparseBooleanArray.get returns a boolean, but I believe you need to check it for each position in your list, e.g.

int len = listView.getCount();
SparseBooleanArray checked = listView.getCheckedItemPositions();
for (int i = 0; i < len; i++)
 if (checked.get(i)) {
  String item = cont_list.get(i);
  /* do whatever you want with the checked item */
 }

Leave a Comment