Turn off GPS programmatically when I exit my program

I started programming GPS Intent myIntent = new intention (Settings.ACTION_SECURITY_SETTINGS); mContext.startActivity (myIntent);

How to disable GPS when I exit my program ...

+7
android gps
source share
1 answer

Try the following:

locationManager.removeUpdates(myLocationListener); locationManager = null; 

This will disable GPS for this application, but it is still available for use by other applications.

Be sure to test your application on a real phone, because the emulator does not show the same GPS behavior as a real phone.

+7
source share

All Articles