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";