I emphasize that I mean the turn on "location/GPS" on my phone in this same time when i allow to use my location to my app.
In my application i have function that ask the user "if you allow access to information about the location of this device ?"
In fact, everything works as it should, when I reject a permission - application is turned off, and if I allow permission - this application starts up and use my location (but only if LOCATION is enabled on phone - it is my problem).
Now I have a problem because I wanted to make it as in a application maps from Google, that when I allow to use my location, function in my phone "LOCATION" it turns ON, because currently even as a allow my application to access location this also additional manually need to turn on "Location" in my phone.
What should I do in my application? It exist is a method which enables the GPS on your phone?
I dream of such a method to my application like : ***
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// permission granted
permissionIsGranted = true;
*** turn on GPS on PHONE!!!!!!!!!!!!!!();
} else {
//permission denied
permissionIsGranted = false;
finishAffinity();