Code example for SparseArray

Methods: clear, put

0
			} 
			break; 
		// This mode will remove all the checked positions from other groups 
		// and enable just one from the selected group 
		case CHOICE_MODE_SINGLE_ABSOLUTE:
			checkedPositions.clear();
			SparseBooleanArray checkedChildPositionsSingleAbsolute = new SparseBooleanArray();
			checkedChildPositionsSingleAbsolute.put(childPosition, true);
			checkedPositions.put(groupPosition, checkedChildPositionsSingleAbsolute);
			break; 
		} 
 
		// Notify that some data has been changed 
		notifyDataSetChanged();
		Log.v(LOG_TAG, "List position updated");
		Log.v(LOG_TAG, PrintSparseArrays.sparseArrayToString(checkedPositions));
	} 
 
	public int getChoiceMode() { 
		return choiceMode;
	}