Display an Android Sensors List

后端 未结 4 1876
梦谈多话
梦谈多话 2021-02-01 18:46

I\'m trying to display a list of available sensors but it\'s like there are not!
I was thinking that it was because of the emulator, but i tried it on the phone and the re

4条回答
  •  攒了一身酷
    2021-02-01 19:26

    The constant SensorManager.SENSOR_ALL is deprecated and doesn't seem to work anymore.

    Query the sensor list with Sensor.TYPE_ALL instead and it should work (my emulator returns a "Goldfish 3-axis Accelerometer").

提交回复
热议问题