Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/180.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 通过意向书挑选联系人是否需要棉花糖运行时许可?_Android - Fatal编程技术网

Android 通过意向书挑选联系人是否需要棉花糖运行时许可?

Android 通过意向书挑选联系人是否需要棉花糖运行时许可?,android,Android,我正在使用通过Intent选择联系人的代码,未经READ_contact许可,它工作正常 val contactPickerIntent = Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Phone.CONTENT_URI) startActivityForResult(contactPickerIntent, RESULT_PICK_CONTACT) 未经允许,我可以获得手机号码和姓名,所以使用此代码可以吗?我对未经允

我正在使用通过Intent选择联系人的代码,未经READ_contact许可,它工作正常

val contactPickerIntent = Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Phone.CONTENT_URI)
startActivityForResult(contactPickerIntent, RESULT_PICK_CONTACT)
未经允许,我可以获得手机号码和姓名,所以使用此代码可以吗?我对未经允许使用代码感到困惑,所以请给我建议,谢谢


参考链接:,

您可以使用通过onActivityResult返回的Uri,无需额外权限。ACTION_PICK协议的一部分授予您使用Uri标识的内容的权限,而无需请求特定权限。

因此,无需额外权限即可使用我的代码,谢谢提供详细信息。