2014-04-30 34 views

回答

0

你最好的选择是设置与类型应用/ vnd.android.package归档的意图,然后开始安装活动:

Intent promptInstall = new Intent(Intent.ACTION_VIEW) 
    .setDataAndType(Uri.parse("file:///path/to/your.apk"), 
        "application/vnd.android.package-archive"); 
startActivity(promptInstall); 

退房Install Application programmatically on Android

另外,还要注意,出于安全原因,您无法安装apk的“静默”或自动安装,无需用户同意。因此,你能做的最好就像上面那样。

相关问题