zl程序教程

您现在的位置是:首页 >  移动开发

当前栏目

Android安装后没有完成和打开按钮

Android安装 打开 没有 完成 按钮
2023-09-11 14:18:37 时间
                    File apkFile = new File(filePath);
                    Intent intent = new Intent();
                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //如果不加,最后安装完成,点打开,无法打开新版本应用。
                    intent.setAction(Intent.ACTION_VIEW);
                    intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");
                    startActivity(intent);
                    android.os.Process.killProcess(android.os.Process.myPid()); //如果不加,最后不会提示完成、打开。