安卓:发送的意图,浏览器打开特定的URL [英] Android: Sending an Intent to Browser to open specific URL

查看:109
本文介绍了安卓:发送的意图,浏览器打开特定的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道如何在一个Intent火起来到手机上的浏览器打开一个特定的网址,并显示出来。

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 a hint?

时也有一个方法可以直接通过COORDS谷歌地图显示?

Is there also a way to pass coords directly to google maps to display?

推荐答案

要打开一个URL /网站,你做到以下几点:

To open a URL/website you do the following:

String url = "http://www.example.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);

下面的 Intent.ACTION_VIEW 文档> 。

Here's the documentation of Intent.ACTION_VIEW.

这篇关于安卓:发送的意图,浏览器打开特定的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆