Google Play Services LocationServices.API - 新选项“永不” [英] Google Play Services LocationServices.API - new option "never"

查看:1174
本文介绍了Google Play Services LocationServices.API - 新选项“永不”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已解决 - 解决问题的结局



我使用新的方式从Google Play Services 7.0中检索位置:





我们需要添加到我们的构建器方法setAlwaysShow(布尔显示)



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);

之后,我们只有两个选项 - 是和否。 b $ b

解决方案

您可以从


设置清除默认设置。 - >应用程序管理器 - >点击Google Play服务 - >点击
清除默认值


这会清除您的首选项选定为从未


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).

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:

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".

解决方案

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

这篇关于Google Play Services LocationServices.API - 新选项“永不”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆