I am developing an application that should calibrate the accelerometer in several stages.
What I did was create a SensorEventListener that receives a certain amount of readings, and after reaching this amount I call "sensorManager (). UnregisterListener (eventListener)".
However, I think that this line does not cancel the registration of the listener, since immediately after that the same line is called as a result of continuing work.
Question: Am I doing everything right or should the handler be processed in such a way that after reaching this condition it will not allow it to start (using if's)?
source share