1

I'm trying to use the new SettingsApi (https://developer.android.com/reference/com/google/android/gms/location/SettingsApi.html) from GooglePlayServices to detect the need for changes on users settings without exiting the app.

My problem is that the dialog appears, but it only says it will require the Wifi and internet to access location. I also want it to request the GPS (this, is the High Accuracy mode or the device only mode).

My code for getting the LocationSettingsRequest:

public static LocationSettingsRequest getHighPriorityLocationSettingsRequest() {
        LocationRequest locationRequest = LocationRequest.create();
        locationRequest.setFastestInterval(FASTEST_INTERVAL);
        locationRequest.setInterval(UPDATE_INTERVAL_ACTIVE);
        locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);

        return new LocationSettingsRequest.Builder()
                .addLocationRequest(locationRequest)
                .setAlwaysShow(true)
                .build();
    }

Thank you!

Fábio Carballo
  • 3,245
  • 5
  • 26
  • 36

1 Answers1

0

The dialog only lists the changes needed to put your location settings to a more optimized states. Thus it won't ask you for GPS when:

  • GPS is not available on your device, or
  • GPS is already on.

By the way, neither FASTEST_INTERVAL nor UPDATE_INTERVAL_ACTIVE has any effect on that dialog.

Lifu Tang
  • 1,271
  • 9
  • 11