我想下面的代码来安装保存在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