13

SOLVED - ANSWER AT THE END

I'm using new way to retrieve location from Google Play Services 7.0:

http://android-developers.blogspot.com/2015/03/google-play-services-70-places-everyone.html https://developer.android.com/reference/com/google/android/gms/location/SettingsApi.html

On the beginning, it gives us only two options, "Cancel" and "Turn on" (picture below).

enter image description here

But today I saw new "feature" with new update of Google Play Services - when my location is turned off and try to get it via Google Play Services, popped dialog gives me options:

enter image description here

Yes, NEVER. When I clicked it, my app will NEVER get location via Google Play Services, even if it's on and I have no other option but re-install app or clear all data, Google gives no other options to change once selected option.

How can I handle this situation? Is there any way to change once selected "never" option without deleting all data from application?

EDIT:

I've found the solution here: How to show enable location dialog like Google maps?

We need add to our builder method setAlwaysShow (boolean show)

https://developer.android.com/reference/com/google/android/gms/location/LocationSettingsRequest.Builder.html#setAlwaysShow(boolean)

LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
.addLocationRequest(mLocationRequestBalancedPowerAccuracy);

builder.setAlwaysShow(true);

After that we have only two options - "Yes" and "No".

Community
  • 1
  • 1
miecio
  • 315
  • 1
  • 4
  • 19
  • This is the same problem that we have on IOS, feel lucky for having a workaround on Android. – Nanoc Jun 19 '15 at 11:48

1 Answers1

0

You can clear the default settings from

Settings -> Application manager -> Click Google Play Services -> Click Clear defaults

This will clear your preference previouls selected as never

Kushal
  • 8,100
  • 9
  • 63
  • 82
  • 2
    Yes, but how non-geek user could figured it out when he missclicked "never" or changed mind? Besides, it'll clear all data, even from other apps, so it's not a good solution. – miecio Apr 27 '15 at 10:08