Code example for SparseBooleanArray

Methods: clear

0
    	return (mChoiceMode == CHOICE_MODE_MULTIPLE);
    } 
 
    void confirmCheckedPositionsById() { 
        // Clear out the positional check states, we'll rebuild it below from IDs. 
        mCheckStates.clear();
 
        boolean checkedCountChanged = false;
        for (int checkedIndex = 0; checkedIndex < mCheckedIdStates.size(); checkedIndex++) {
            final long id = mCheckedIdStates.keyAt(checkedIndex);
            final int lastPos = mCheckedIdStates.valueAt(checkedIndex);
 
            final long lastPosId = getItemId(lastPos);
//            Logger.debug("id = %d, lastPos = %d, lastPosId = %d", id, lastPos, lastPosId); 
            if (id != lastPosId) {
                // Look around to see if the ID is nearby. If not, uncheck it. 
                final int start = Math.max(0, lastPos - CHECK_POSITION_SEARCH_DISTANCE);
                final int end = Math.min(lastPos + CHECK_POSITION_SEARCH_DISTANCE, getCount());
                boolean found = false;
                for (int searchPos = start; searchPos < end; searchPos++) {
                    final long searchId = getItemId(searchPos);