private void deleteSelectedItems(){
  SparseBooleanArray positions=listView.getCheckedItemPositions();
  List<Todo> deletions=new ArrayList<Todo>();
  if (positions.size() == 1) {
    deletions.add(adapter.getItem(positions.keyAt(0)));
  }
 else {
    for (int i=0; i < positions.size(); i++) {
      int key=positions.keyAt(i);
      if (positions.get(key)) {
        deletions.add(adapter.getItem(key));
      }
    }
  }
  for (  Todo item : deletions) {
    TodoHelper.deleteTodo(getContentResolver(),item);
  }
  adapter.clearSelections();
}

private void deleteSelectedItems ( ) { SparseBooleanArray positions = listView . getCheckedItemPositions ( ) ; List < Todo > deletions = new ArrayList < Todo > ( ) ; if ( positions . size ( ) == 1 ) { deletions . add ( adapter . getItem ( positions . keyAt ( 0 ) ) ) ; } else { for ( int i = 0 ; i < positions . size ( ) ; i ++ ) { int key = positions . keyAt ( i ) ; if ( positions . get ( key ) ) { deletions . add ( adapter . getItem ( key ) ) ; } } } for ( Todo item : deletions ) { TodoHelper . deleteTodo ( getContentResolver ( ) , item ) ; } adapter . clearSelections ( ) ; }
deletes the selected items
