Code example for HandlerThread

Methods: getLooper, getName, interrupt, quit, start

0
	public int stopStream() { 
		Log.w(TAG, "Stopping GPS stream");
		Log.w(TAG, "There are "+Integer.toString(locQueue.size())+" elements left in the queue");
		locationManager.removeUpdates(locationListener);
		try { 
		handlerThread.quit();
		handlerThread.interrupt();
		} catch (Exception e) { 
			e.printStackTrace();
			return 0; 
		} 
		isStreaming = false;
		locQueue.clear();
		return 1; 
	} 
	 
	/* "changeFrequency", "(J)I" */ 
	public int changeFrequency(/*long minTime*/) { 
		if (!isStreaming) return 0;
		if ( stopStream()==1 ) { 
			if ( startStream(/*minTime*/)==1 ) return 1;