Code example for SparseArray

Methods: clear, size

0
	 
	@Override 
	protected void onExecute() { 
		super.onExecute(); 
		SparseArray<Task> waitingTasks = this.waitingTasks;
		for (int index = 0; index < waitingTasks.size(); index++) {
			int key = waitingTasks.keyAt(index);
			Task task = waitingTasks.get(key);
			this.tasks.put(key, task); 
			task.onRun();
		} 
		waitingTasks.clear();
	} 
	 
	@Override 
	protected void onExecute(Intent i) { }
	 
	private void addTask(Task t, Messenger resultMessenger, int resultCode) {
		t.initialize(this, this.taskId, resultMessenger, resultCode);
		if (this.xmppService != null && this.xmppConnected) {
			this.tasks.put(this.taskId, t);