我想下面的代碼來安裝保存在SD卡上的apk文件,並得到以下異常:「android.content.ActivityNotFoundException:無法找到顯式活動類{com.android.packageinstaller/.PackageInstallerActivity} 」。在代碼中,file
代表apk文件的SD卡路徑。安裝apk程序錯誤
Intent resultIntent = new Intent(android.content.Intent.ACTION_VIEW);
resultIntent.setDataAndType(Uri.fromFile(file),"application/vnd.android.package-archive");
resultIntent.setClassName("com.android.packageinstaller", ".PackageInstallerActivity");
startActivity(resultIntent);
請讓我知道如何管理這個。
感謝 賈韋德汗
`file`是否有效? – dbm 2011-02-01 09:45:42