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

在Xiaomi 红米note5 android 8.1 api27上报错 #19

Open
xingstarx opened this issue Jul 31, 2018 · 0 comments
Open

在Xiaomi 红米note5 android 8.1 api27上报错 #19

xingstarx opened this issue Jul 31, 2018 · 0 comments

Comments

@xingstarx
Copy link

使用android-auto-update-v1.2.apk安装后,点击对话框更新报错,本质上你没有处理

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
             //先获取是否有安装未知来源应用的权限
             boolean haveInstallPermission = getPackageManager().canRequestPackageInstalls();
             if (!haveInstallPermission) {
                 //跳转设置开启允许安装
                 Uri packageURI = Uri.parse("package:"+context.getPackageName());
                 Intent intent =new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES,packageURI);
                 startActivityForResult(intent,1000);
                 return;
             }
         }

处理canRequestPackageInstalls

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