1

Salaam my friends,

Is there any specific code that I can use to turn off the location services in my phone from my app?

Regards, Tareq Al-Aqarbeh

Tareq
  • 113
  • 6
  • sorry mate check out this answer : http://stackoverflow.com/questions/13481653/how-to-disable-location-service-programmatically – Itzik Samara Aug 06 '14 at 14:31
  • The answer is here http://stackoverflow.com/questions/1051649/how-to-programmatically-enable-gps-in-android-cupcake http://stackoverflow.com/questions/11546214/android-once-click-off-on-location-services – Igor Ronner Aug 06 '14 at 14:32
  • Thank you Samara and Ronner. I appreciate it. – Tareq Aug 06 '14 at 14:37

1 Answers1

4

You cannot actually mess directly with the device settings. All you can do is start the location settings intent through your app so the user can turn on/off what you need

Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(intent);
Klitos G.
  • 806
  • 5
  • 14