Code example for ExecutorService

Methods: isShutdown, shutdown

0
	public void cancel(){ 
		cancel = true;
		 
		// We could also terminate it immediately, 
		// but that may lead to synchronization issues. 
		if(!mExecutor.isShutdown()){
			mExecutor.shutdown();
		} 
		 
		stopPurgeTimer(); 
		 
		mContext = null;
		clearCaches(); 
	} 
	 
	/** 
	 * Stops the cache purger from running until it is reset again. 
	 */ 
	public void stopPurgeTimer(){ 
		purgeHandler.removeCallbacks(purger);
	}