This seems like a basic question, but after searching for a while and playing with it, I\'ve come to the point where some help would be appreciated. I would like to have a
Create handler for the current thread where you are registering your listener and pass it to the listener as third argument.
public void run() {
Log.d( "RunTag", Thread.currentThread().getName() ); // To display thread
mSensorManager = (SensorManager)getSystemService( SENSOR_SERVICE );
mSensor = mSensorManager.getDefaultSensor( Sensor.TYPE_ACCELEROMETER );
MySensorListener msl = new MySensorListener();
Looper.perpare;
Handler hndlr = new Handler();
mSensorManager.registerListener(msl, mSensor,
SensorManager.SENSOR_DELAY_UI, hndlr);
Looper.loop;
}