Code example for BlockingQueue

Methods: removeAll

0
	 */ 
	public void stopService() { 
		Log.d(TAG, "Stopping service..");
 
		clearNotification(); 
		_queue.removeAll(_queue); // TODO is this safe?
		_isQueueRunning.set(false);
		_callback = null;
		_isRunning.set(false);
 
		// close socket 
		try { 
			_sock.close();
		} catch (IOException e) {
			Log.e(TAG, e.getMessage());
		} 
 
		// kill service 
		stopSelf();
	}