QemuSensors Error in LogCat

When I try to implement SensorEventListener in my application, I repeatedly received the following error message in LogCat:

12-25 17:33:57.210: ERROR/QemuSensors(58): data__poll: len=-1, errno=9: Bad file number

And this is how I declare a listener inside an activity class:

private final SensorEventListener mSensorListener = new SensorEventListener() {

    public void onSensorChanged(SensorEvent se) {
        // do something
    }

    public void onAccuracyChanged(Sensor sensor, int accuracy) {
        // do something
    }
};

It is strange that the application and the sensor seem to be working fine. Does anyone know how this happened and how to fix it?

thank

+3
source share

Source: https://habr.com/ru/post/1782419/


All Articles