1

In my app I'm try to get last known location (when user klick on specific button). According to Google principle, to do that I'm using getLastLocation() method via Google Play Services.

http://developer.android.com/training/location/retrieve-current.html#last-known

That working just fine, but when Location is disabled in device settings, I'm using SettingsApi to show dialog to the user without leaving application, where he can turn on necessary settings.

https://developers.google.com/android/reference/com/google/android/gms/location/SettingsApi

And this working fine too, BUT even when I set PRIORITY_LOW_POWER (that’s all I need), the dialog ask (apart of turning on needed location settings) that if I want also turn on WiFi scanning:

enter image description here

This even ask if I want to enable WiFi scanning when location is turned on with highest precision! Generally, it always ask whet the WiFi is turned off. It’s really annoying, especially when in Android 6 exists a WiFi bug causes draining battery and the only workaround is turning off WiFi scanning:

https://code.google.com/p/android/issues/detail?id=188909

So here is my question - is there any possibility to use SettingsApi dialog to turn on Location WITHOUT WiFi scanning?

Here is a snippet of my code:

    LocationRequest locationRequest = new LocationRequest().setPriority(LocationRequest.PRIORITY_LOW_POWER);

    LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
            .addLocationRequest(locationRequest)
            .setAlwaysShow(true);

    PendingResult<LocationSettingsResult> result =
            LocationServices.SettingsApi.checkLocationSettings(googleApiClient, builder.build());
miecio
  • 315
  • 1
  • 4
  • 19
  • this inquiry is a bit similar to this - http://stackoverflow.com/questions/33251373/turn-on-location-services-without-navigating-to-settings-page – adjuremods Mar 26 '16 at 02:38
  • @adjuremods, not at all, I know how to turn on location without navigating to settings page, my question is about something else. Read carefully, please. – miecio Mar 29 '16 at 08:14

0 Answers0