0
我创建了应用程序和更新程序应用程序。在更新应用程序是非常简单,它加载了最新的版本,如果有的话,然后用下面的代码安装它:应用程序操作自Android 4.4.2以来无法正常工作
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(PATH_TO_APK)), "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
它是在所有的Android版本运作良好,但在Android 4.4.2,在任何权限后对话框,它说该应用程序无法安装。
的PATH_TO_APK如下:
Environment.getExternalStorageDirectory().getPath() + "/.temp.apk";