public boolean updateSelectedItemsList ( int dataIndex , boolean select ) { boolean done = false ; boolean contains = isSelected ( dataIndex ) ; if ( select ) { if ( ! contains ) { if ( ! mMultiSelectionSupported ) { clearSelection ( false ) ; } Log . d ( Log . SUBSYSTEM . LAYOUT , TAG , "updateSelectedItemsList add index = %d" , dataIndex ) ; mSelectedItemsList . add ( dataIndex ) ; done = true ; } } else { if ( contains ) { Log . d ( Log . SUBSYSTEM . LAYOUT , TAG , "updateSelectedItemsList remove index = %d" , dataIndex ) ; mSelectedItemsList . remove ( dataIndex ) ; done = true ; } } return done ; }
Update the selection state of the item