2012-12-10 119 views
0

我試圖在這裏單獨實現這個問題的代碼 Android: install .apk programmatically, 其中涉及如何實現我想要在Android上與Java的東西。 我想用monodroid來做。如何以編程方式安裝apk與monodroid

任何人任何想法如何我不斷收到錯誤...

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); 
+0

什麼是錯誤信息? –

回答

0

對於此行: intent.setDataAndType(Uri.fromFile(apkFile), 「應用/ vnd.android.package存檔」 );

你嘗試: intent.setDataAndType(Uri.fromFile(新的java.io.File( 「pathToAPK」), 「應用/ vnd.android.package歸檔」);