I'm trying to implement multiple list item selection and user can perform actions based on menu item appears on actionbar.
I have tried a way ListView.CHOICE_MODE_MULTIPLE_MODAL
but this option works only for API 11 or above.
Is there a way we can make use of the same technique for API 11 below i.e below code works only API 11 onwards.
list.setMultiChoiceModeListener(new MultiChoiceModeListener() {
@Override
public void onItemCheckedStateChanged(ActionMode mode,
int position, long id, boolean checked) {
// Capture total checked items
final int checkedCount = list.getCheckedItemCount();
// Set the CAB title according to total checked items
mode.setTitle(checkedCount + " Selected");
// Calls toggleSelection method from ListViewAdapter Class
listviewadapter.toggleSelection(position);
}