user7090887 user7090887 - 4 months ago 44
Android Question

How to check in realtime if Location services switched off by user in a tracking app

I am developing a tracking app using fused location api. I want to check pragmatically if user has turned off location services while app is running. I am thinking of running a parallel thread to check if GPS has been turned off by user in every 5 sec using method LocationManager.isProviderEnabled(). Is this the right approach or there is a better way to do it.



Use broadcast receiver, when GPS settings will be changes, you will get automatically notify.

here is the link: