【发布时间】:2011-01-13 04:49:45
【问题描述】:
如何在内置 Web 浏览器中而不是在我的应用程序中通过代码打开 URL?
我试过这个:
try {
Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(download_link));
startActivity(myIntent);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, "No application can handle this request."
+ " Please install a webbrowser", Toast.LENGTH_LONG).show();
e.printStackTrace();
}
但我遇到了异常:
No activity found to handle Intent{action=android.intent.action.VIEW data =www.google.com
【问题讨论】:
-
为什么这在某些设备上不起作用?即使有网络浏览器,它也会进入 ActivityNotFoundException。
-
我看到与@Manu 相同的问题。 Nexus 6 上的基本安装,具有 chrome,但链接导致异常。
-
我可以隐藏地址栏吗? @Arutha
标签: android url android-intent android-browser