How to keep GPS turned on when switching between activities but off when when “home” is pressed
问题 I am trying to figure out the best way to implement Listener to location with the onResume and onPause. Best I can do not it to turn it off on onPause and reconnect on onResume. But then I keep having disconnect-reconnect when all I want is for the GPS to stay on for the duration of the application. When Home is pressed (or another application is interrupting) then GPS can be downed off for battery saving. Any ideas? Thanks. 回答1: Your question can be generalized to "How do I tell when my app