2017-06-23 35 views
-1

请让我知道什么是身份的权限?以及如何从代码实现这种权限?如何在Android中请求身份权限?

II已经实现了联系人阅读和其他运行时权限,但无法找到任何关于身份许可的内容。

+0

可能重复的问题,请选中该https://stackoverflow.com/questions/33295810/where - 我的应用程序许可身份在Android的棉花糖 –

回答

0
Identity – With this permission the app can find accounts on the device, see and modify the owner’s contact card and add or remove contacts from the device. The permission **group CONTACTS deals with the user’s contacts while ACCOUNT_MANAGER deals with the user’s accounts.** 

<uses-permission android:name="android.permission-group.CONTACTS"/> 
<uses-permission android:name="android.permission.ACCOUNT_MANAGER"/> 

At code level one can set permission by using **https://developer.android.com/training/permissions/requesting.html** 
First check 
// Assume thisActivity is the current activity 
int permissionCheck = ContextCompat.checkSelfPermission(thisActivity, 
     Manifest.permission.group.CONTACTS); 
+0

我试过这个,但获取错误为错误:(11)标记属性名称具有无效字符' - '。 由此可知: - android.permission-group –

+0

可能会解决您的问题 –