本地.apk文件安裝意圖當我在Android 2.1安裝其他應用程式的新APK,我只是用:上薑餅
Intent intent2 = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory()+"/Download/" + "app.apk")), "application/vnd.android.package-archive");
startActivity(intent2);
它開闢了新的安裝對話框,我可以使用它。
現在,我嘗試薑餅2.3.3相同的代碼,當我開始這個安裝的意圖,它讓我選擇「選擇使用操作的應用程序」。有以下選擇:Google talk,video,videotalk,DRM,Market。
發生了什麼事?薑餅的安裝意圖是否改變了?如何在Android Gingerbread上製作新的安裝意圖?感謝
嘗試使用適當的'File'構造函數而不是字符串連接創建'File'對象,看看是否有幫助。 – CommonsWare
不,問題是,它看起來像Android 2.3的不知道對應的MIME類型... – Waypoint
['PackageInstaller'確實](http://www.google.com/codesearch#cZwlSNS7aEw/packages/apps/PackageInstaller/ AndroidManifest.xml&exact_package = android&q = application/vnd.android.package-archive&type = cs) – CommonsWare