当下载完APK时,提示安装APK的代码:
File file = new File(Environment.getExternalStorageDirectory(),"xxx.apk");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setDataAndType(Uri.fromFile(result),"application/vnd.android.package-archive");
startActivity(intent);
原创:转载请声明出处,谢谢!