Code example for HandlerThread

Methods: getLooper, quit, start

0
        if (lm == null) {
            lm = (LocationManager) getSystemService(LOCATION_SERVICE);
        } 
        lm.addGpsStatusListener(gpsListener);
 
        theGPSThread = new HandlerThread("GPSThread");
        theGPSThread.start();
        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, GPS_MIN_POLL * 1000, GPS_MIN_DISTANCE, gpsListener, theGPSThread.getLooper());
    } 
 
    @Override 
    public IBinder onBind(Intent intent) {
        //Log.d(LOG_NAME, "We've been bound"); 
        return mBinder;
    } 
 
    @Override 
    public void onCreate() { 
        //Log.d(LOG_NAME, "TheGPSService created"); 
    }