Disable GPS via code in Android 4.2 up?

1

How can I disable GPS via code without user intervention?

    
asked by anonymous 02.08.2016 / 16:07

1 answer

0

Try this strategy, it worked for me some time ago in the project that was, I do not remember the version I used Android - it only had this stretch saved for backup.

Intent intent = new Intent("android.location.GPS_ENABLED_CHANGE");
intent.putExtra("enabled", false);
sendBroadcast(intent);
    
02.08.2016 / 16:23