如何在android中请求身份权限?

时间:2017-06-23 07:36:40

标签: android android-permissions

请告诉我什么是身份权限?如何从代码中实现这种权限?

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

2 个答案:

答案 0 :(得分:0)

GET_ACCOUNTS以前在身份权限组中。

它已移至Android 6中的“联系人”权限组。

https://developer.android.com/reference/android/Manifest.permission.html#GET_ACCOUNTS

Android 6.0 permission.GET_ACCOUNTS

答案 1 :(得分: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);