Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

android 11 中 获取应用列表时一个神奇现象 #362

Open
dongbeicxy opened this issue Mar 3, 2023 · 0 comments
Open

android 11 中 获取应用列表时一个神奇现象 #362

dongbeicxy opened this issue Mar 3, 2023 · 0 comments

Comments

@dongbeicxy
Copy link

系统:鸿蒙3.0,android 11

流程:
【1】
配置文件中添加:

【2】
MainActicity中添加:
PackageManager packageManager = getPackageManager();
List packageInfolist = packageManager.getInstalledPackages(0);

现象:
进入MainActivity,会出现权限请求弹窗

问题:
点击弹窗中的同意或者拒绝后,我调用
ContextCompat.checkSelfPermission(context,
Manifest.permission.QUERY_ALL_PACKAGES)
想判断权限是否授予,但结果总是返回 PERMISSION_GRANTED

请教大佬这是什么原因呢?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant