skittlemittle / shakyroads

logs acceleration and location coordinates in a csv, abandoned till later
MIT License
0 stars 0 forks source link

Release GPS and accelerometer in onStop() #10

Closed skittlemittle closed 5 years ago

skittlemittle commented 5 years ago

You can also use the onPause() method to release system resources, handles to sensors (like GPS), or any resources that may affect battery life while your activity is paused and the user does not need them. However, as mentioned above in the onResume() section, a Paused activity may still be fully visible if in multi-window mode. As such, you should consider using onStop() instead of onPause() to fully release or adjust UI-related resources and operations to better support multi-window mode.

when in split screen it stops working, so only releasing sensors in onStop() is a good idea