以编程方式安装后Android重启apk

时间:2013-08-07 08:47:41

标签: android install apk restart android-install-apk

我已经完成了一个类下载新版本的apk并使用以下代码以编程方式安装

Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/"  + ApkName)), "application/vnd.android.package-archive");
context.startActivity(intent);  

它有效,它会安装新的apk(以前在SD上下载),但之后应用程序没有重新启动但已关闭。

安装新版本后有办法让它重新启动吗?

谢谢!

0 个答案:

没有答案