发送意图到浏览器以打开特定的URL [英] Sending an Intent to browser to open specific URL
本文介绍了发送意图到浏览器以打开特定的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是想知道如何向手机浏览器启动一个Intent以打开特定的URL并显示它.
有人可以给我一个提示吗?
解决方案
要打开URL/网站,请执行以下操作:
String url = "http://www.example.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
这是 来源:从应用程序内部在Android的网络浏览器中打开URL I'm just wondering how to fire up an Intent to the phone's browser to open an specific URL and display it. Can someone please give me a hint? To open a URL/website you do the following: Here's the documentation of Source: Opening a URL in Android's web browser from within application 这篇关于发送意图到浏览器以打开特定的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!Intent.ACTION_VIEW
的文档.>
解决方案 String url = "http://www.example.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
Intent.ACTION_VIEW
.
查看全文