我尝试从为URL安装APK,这是我的code:
I try to install an apk from an URl, this is my code:
Intent promptInstall = new Intent(android.content.Intent.ACTION_VIEW);
promptInstall.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
promptInstall.setDataAndType(Uri.parse("http://10.0.2.2:8081/MyAPPStore/apk/Teflouki.apk"), "application/vnd.android.package-archive" );
startActivity(promptInstall);
不过,我有这样的问题:
But i have this problem:
05-10 15:09:29.511: ERROR/AndroidRuntime(1668): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=http://10.0.2.2:8081/MyAPPStore/apk/Teflouki.apk typ=application/vnd.android.package-archive flg=0x10000000 }
在此先感谢
这将不利于如果应用程序不可用在mearketplace,但在情况下,它是:
This won't help if the app is not available on the mearketplace, but in case it is:
Uri marketUri = Uri.parse("market://search?q=pname:com.appmaker.tefloukipackage");
Intent marketIntent = new Intent(Intent.ACTION_VIEW, marketUri);
try {
context.startActivity(marketIntent);
} catch (ActivityNotFoundException ex) {
showAlertDialog(context, "Error", "Could not launch the market application.", true, null);
}
上一篇:检测是否在 VBA 中选择了表单控件选项按钮表单、控件、按钮、选项
下一篇:QCheckbox/QRadioButton 换行 Qt4.6.0换行、QRadioButton、QCheckbox