I am using exactly this code in this example
What should i include in MyMethod() to stop the listener and don`t wait for another shake after MyMethod() is called the first time?
Thanks
I am using exactly this code in this example
What should i include in MyMethod() to stop the listener and don`t wait for another shake after MyMethod() is called the first time?
Thanks
The line
sensorMgr.unregisterListener(this);
will make the system stop sending you onSensorChanged updates
finally found the answer:
this is not enough for unregister the listener, you also need to set your SensorEventListener to null
sensorMgr.unregisterListener(this);
msensorlistener = null;
this trick works very good,
hope it helps.