private OnMultiChoiceClickListener createListItemListener ( ) { return new OnMultiChoiceClickListener ( ) { @ Override public void onClick ( final DialogInterface dialog , final int which , final boolean isChecked ) { if ( isChecked ) { selectedIndices . add ( which ) ; } else { selectedIndices . remove ( which ) ; } } } ; }
Creates and returns a listener which allows to observe when list items are selected or unselected by the user .