Detecting Taps - error thrown
I am trying to detect double taps and use the example from the docs. It works, but the switch statement that checks for double/single tap seems to cause an issue:
04-07 13:46:27.036 32113-32137/com.hybris.labs.fit E/MetaWear: Background task reported an error
java.util.concurrent.ExecutionException: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.mbientlab.metawear.module.Bmi160Accelerometer$TapType.ordinal()' on a null object reference
...
at com.mbientlab.metawear.MetaWearBleService$3.run(MetaWearBleService.java:1263)
at java.util.Timer$TimerImpl.run(Timer.java:284)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.mbientlab.metawear.module.Bmi160Accelerometer$TapType.ordinal()' on a null object reference
at com.hybris.labs.fit.MainActivity$7$1.process(MainActivity.java:249)
at com.mbientlab.metawear.impl.DefaultMetaWearBoard$57.run(DefaultMetaWearBoard.java:3915)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
When I remove the switch statement for checking on single/double taps, it works. Also, I start the double tap detection with bmi160AccModule.enableTapDetection(Bmi160Accelerometer.TapType.DOUBLE);
Why do I need to distinguish between single/doublel taps then?
This discussion has been closed.
Comments