📌  相关文章
📜  java.lang.SecurityException: Permission Denial: reading androidx.core.content.FileProvider - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:41.788000             🧑  作者: Mango

代码示例1
List resInfoList = context.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
for (ResolveInfo resolveInfo : resInfoList) {
    String packageName = resolveInfo.activityInfo.packageName;
    context.grantUriPermission(packageName, uri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION);
}