Code example for HandlerThread

Methods: getLooperstart

	public void onCreate() { 
		// TODO: It would be nice to have an option to hold a partial wakelock 
		// during processing, and to have a static startService(Context, Intent) 
		// method that would launch the service & hand off a wakelock. 
		HandlerThread thread = new HandlerThread("IntentService[" + mName + "]");
		mServiceLooper = thread.getLooper();
		mServiceHandler = new IntentServiceHandler(mServiceLooper, this);
	public void onStart(Intent intent, int startId) {
		Message msg = mServiceHandler.obtainMessage();
		msg.arg1 = startId;
		msg.arg2 = 0;
		msg.obj = intent;
Stop searching for code, let great code find you!  Add Codota to your java IDE