My application uses GPS, so I delete GPS updates on onStop (), so it does not use the battery if it is not. However, I noticed that the battery on my test phone worked if my application was open when the lock screen is on.
So, to test this, I added Log.i (...) to the onStop () method of my activity. Of course, onStop () is not called when I press the off button on my HTC Incredible (which turns off the screen).
Is there a way to listen to the lock screen or turn off the screen since it does not call onStop (), how should it be?
Thanks.
source share