0

I have tried to implement the code in monodroid for this question here Android: install .apk programmatically, which deals with how to implement what I want on Android with Java. I want to do it with monodroid.

Anyone any idea how I keep getting an error...

File apkFile = new File({path to APK});
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");
startActivity(intent);
4

1 回答 1

0

对于这一行:intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");

你试过了吗:intent.setDataAndType(Uri.fromFile(new Java.IO.File("pathToAPK"), "application/vnd.android.package-archive");

于 2013-09-10T00:01:36.027 回答