Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在 oppo 手机上,android 14获取不到QUERY_ALL_PACKAGES 的权限,应用拒绝了权限 这边还是提示已经有这个权限 #292

Open
chinaliuweijie opened this issue Dec 3, 2024 · 0 comments

Comments

@chinaliuweijie
Copy link

PermissionX.init(this)
.permissions(Manifest.permission.QUERY_ALL_PACKAGES)
.onExplainRequestReason((scope, deniedList) -> {
scope.showRequestReasonDialog(deniedList, "我们需要访问已安装应用列表的权限来提供更好的服务。请允许该权限。", "我已明白");
})
.onForwardToSettings((scope, deniedList) -> {
scope.showForwardToSettingsDialog(deniedList, "您已经拒绝了访问已安装应用列表的权限。请前往设置页面手动授予权限。", "我已明白");
})
.request(new RequestCallback() {
@OverRide
public void onResult(boolean allGranted, List grantedList, List deniedList) {
if (allGranted) {
// 所有权限都已授予
fetchInstalledApps();
} else {
// 用户拒绝了某些权限
Toast.makeText(MainActivity1.this, "无法获取已安装应用列表,请检查权限设置", Toast.LENGTH_LONG).show();
}
}
});

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

No branches or pull requests

1 participant