Code example for SparseBooleanArray

Methods: delete, get, put

0
		 
		return returnView;
	} 
	 
	public void activateGameState(int stateId) {
		activationStates.put(stateId, true);
		notifyDataSetChanged();
	} 
	 
	public void activateAllGameStates() { 
		activationStates.clear();
		for (GameState gameState: gameStateList) {
			activationStates.put(gameState.getId(), true);
		} 
		notifyDataSetChanged();
	} 
	 
	public void deactivateGameState(int stateId) {
		activationStates.delete(stateId);
		notifyDataSetChanged();
	} 
	 
	public void deactivateAllGameStates() { 
		activationStates.clear();
		notifyDataSetChanged();
	} 
	 
	public void toggleGameStateActivation(int stateId) {
		if (isGameStateActivated(stateId)) {
			deactivateGameState(stateId);
		} else { 
			activateGameState(stateId);
		} 
	} 
	 
	public boolean isGameStateActivated(int stateId) {
		return activationStates.get(stateId, false);
	} 
	 
	public boolean isAnyGameStateActivated() { 
		return activationStates.size() > 0;
	}