棉花糖权限实现 [英] Marshmallow permission implementation

查看:166
本文介绍了棉花糖权限实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在现有的Android应用程序中添加对Android 6.0的支持。我已经使用 SYNCADAPTER 来同步数据。直到API 22为止都可以正常工作。但是在23(ANDROID 6.0)中,他们已删除组权限 AUTHENTICATE_ACCOUNTS

I am trying to add Android 6.0 support in my Existing Android App. I have used SYNCADAPTER to sync data. its working fine till API 22. but in 23 (ANDROID 6.0) they have remove Group permission AUTHENTICATE_ACCOUNTS.

I找到了示例如何获取运行时权限,我尝试使用 AUTHENTICATE_ACCOUNTS code>,但是它不起作用。

I found sample how to get run-time permission, I tried same with AUTHENTICATE_ACCOUNTS but it is not working.

我还发现了一个答案,是否有任何技巧可以使用与该答案相同的 AUTHENTICATE_ACCOUNTS

I also found one answer, Is there any trick to use AUTHENTICATE_ACCOUNTS same as that answer?

我发现已删除权限列表在此处。因此,如果我的应用使用列出的权限。在这种情况下,任何应用程序都可以在Android M(6.0)中运行吗?

i found removed permissions list overhere. so if my app use that permission which is listed. in that case does any app works in Android M (6.0)?

推荐答案

在Android 6.0上不再需要AUTHENTICATE_ACCOUNTS。

There is no longer need AUTHENTICATE_ACCOUNTS on Android 6.0.

您可以在上使用 android:maxSdkVersion = 22 从Android 6.0开始,uses-permission 元素将停止请求它。

you can use android:maxSdkVersion="22" on your uses-permission element to stop requesting it as of Android 6.0.

如CommonsWare Sir和此博客有助于进一步了解此问题。

As mentioned in comment by CommonsWare Sir and this blog helped to understand more on this issue.

这篇关于棉花糖权限实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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