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?
Asked
Active
Viewed 259 times
0
-
Also mSensorManager.getDefaultSensor(Sensor.TYPE_SIGNIFICANT_MOTION,true); returns null. – Al117 Aug 15 '18 at 08:57
-
Please add logcat error log. – bluetoothfx Oct 12 '18 at 06:28
1 Answers
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