I am trying to enable/disable (toggle) GPS programmatically in my app via a button click, but it is not working. Please help. My target devices are not rooted.
Here\'s t
You can't enable GPS programatically. The most you can do is open the settings for the user to do that.
You can do it like this:
startActivityForResult(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 100);