Android 11.0 在系统app安装第三方app弹出 解析安装包出现问题 的解决方案

在系统内置app中用代码调用系统安装接口安装app时抛出Permission Denial: that is not exported from UID 1000的异常时,查询资料发现通常是由于Uri权限导致的问题
例如:

File apk = new File(...);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
Uri uri = FileProvider.

猜你喜欢

转载自blog.csdn.net/baidu_41666295/article/details/124643333