7

I have started my GPS programmatically by Intent myIntent = new intent(Settings.ACTION_SECURITY_SETTINGS); mContext.startActivity(myIntent);

How i will turn Off GPS when i exit from my program...

Pentium10
  • 204,586
  • 122
  • 423
  • 502
Eby
  • 2,769
  • 4
  • 23
  • 30

1 Answers1

7

Try this:

locationManager.removeUpdates(myLocationListener);
locationManager = null;

This will shut down GPS for this app, but it is still available for use by other apps.

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

Wesley Murch
  • 101,186
  • 37
  • 194
  • 228
fmo
  • 818
  • 1
  • 8
  • 16