public void setSelection ( int [ ] selectedIndicies ) { for ( int index : selectedIndicies ) { if ( index >= 0 && index < mSelection . length ) { mSelection [ index ] = true ; } else { throw new IllegalArgumentException ( "Index " + index + " is out of bounds." ) ; } } refreshDisplayValue ( ) ; }
Sets the selected options based on an array of positions .