Code example for ExecutorService

Methods: shutdownNow

0
	public boolean stop() { 
		if (mThread != null) {
			mThread.interrupt();
			if (mThreadPool != null) {
				try { 
					mThreadPool.shutdownNow();
				} catch (SecurityException e) {
					Log.w(LOG_TAG, "Could not stop all view server threads");
				} 
			} 
 
			mThreadPool = null;
			mThread = null;
 
			try { 
				mServer.close();
				mServer = null;
				return true; 
			} catch (IOException e) {
				Log.w(LOG_TAG, "Could not close the view server");
			}