android- which Thread does run onSensorChanged?

if I attach a listener to a sensor of the device (like below), in this situation while onSensorChanged happens, which thread does run generateNewRotation method, main Thread or…?

SensorEventListener sensorListener = new SensorEventListener() {

        public void onSensorChanged(SensorEvent event) {


        public void onAccuracyChanged(Sensor sensor, int accuracy) {


OnSensorChanged() gets called inside the Main Thread, also called the UI Thread.

Leave a Reply

Your email address will not be published. Required fields are marked *