Search code examples
androidandroid-sensors

how to get SensorEvent's value when "onSensorChanged(SensorEvent event)" not called?


If I register a listener after the sensor has changed something, I cannot get the changed value and have to wait for the next time when onSensorChanged get called. Is there any way to get current sensor's value in such situation?


Solution

  • The sensor information is only available as SensorEvent in the method onSensorChanged. So without onSensorChanged it will not be possible to get the sensor Events