Android的 - 调用默认浏览器,并重定向到指定的URL [英] Android - Call default browser with and redirect to a designated url

查看:584
本文介绍了Android的 - 调用默认浏览器,并重定向到指定的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想写一个应用程序调用默认浏览器重定向到指定的URL。
任何建议1)调用默认浏览器; 2)重定向到指定的URL。

Hi
I want to write an app to call default browser and redirect to a designated url. Any suggestion to 1)call the default browser, 2)redirect to a designated url.

感谢

推荐答案

你只是想与网页作为数据元素的URI发动ACTION_VIEW意图:

you just want to launch an ACTION_VIEW intent with the Uri of the webpage as your data element :

Intent httpIntent = new Intent(Intent.ACTION_VIEW);
httpIntent.setData(Uri.parse("http://www.bbc.co.uk"));

startActivity(httpIntent);        

这篇关于Android的 - 调用默认浏览器,并重定向到指定的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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