Home Turn on/off gps using button without getting into setting menu

Turn on/off gps using button without getting into setting menu

 it is impossible. Only user can turn on/off GPS. That is done because you shouldn't be able to get user's location if he doesn't want you to get it. Only thing that you can do is to ask him to turn it on/off by opening GPS settings: startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS));