0

I placed Significant Motion Sensor code from https://developer.android.com/guide/topics/sensors/sensors_motion#sensors-motion-significant in my activity. But the app crashes as soon as it is launched. What is the correct way to implement Significant Motion Sensor?

Al117
  • 55
  • 1
  • 8

1 Answers1

0

If

mSensorManager.getDefaultSensor(Sensor.TYPE_SIGNIFICANT_MOTION,true);

returns null it's pretty likely that your device does not support this sensor. You should consider to use Accelerator directly as alternative.

Fintasys
  • 1,309
  • 1
  • 9
  • 16