This is the question about the activity life-cycle vs. location updates. From what I read, I should register location updates in OnResume and remove location updates in OnPause of my activities. But, my app shows your current speed in real time (location updates set to 1 second and 0 meters) and has several activities - home screen, some list, settings screen, etc.
If I use OnPause or OnStop for remove location updates and OnResume to get them back again, and user just goes to another screen and then back to home, there is significant lag in receiving data and speed cannot be shown. Is there any way to distinguish between user going to another activity within my app, and leaving app - for the purpose of removing location updates?
I know about OnUserLeaveHint event, but no luck here - it is fired also when user is just going for settings screen and back.