您的位置:首页 > 移动开发 > Android开发

android中调用浏览器的代码

2013-11-06 13:59 411 查看
android中调用浏览器的代码http://www.2cto.com/kf/201111/109800.html
2011-11-02 08:52:00 我来说两句 收藏


我要投稿

默认的浏览器都列出让用户选择的

Java代码

Uri u = Uri.parse(url);

Intent it = new Intent(Intent.ACTION_VIEW, url); TestActivity.this.startActivity(it);

Uri u = Uri.parse(url);

Intent it = new Intent(Intent.ACTION_VIEW, url); TestActivity.this.startActivity(it);

指定浏览器的

Java代码

Uri u = Uri.parse(url);

it.setData(u);

it.setAction( Intent.ACTION_VIEW);

it.setClassName("com.android.browser","com.android.browser.BrowserActivity");

TestActivity.this.startActivity(it);

摘自hellorheaven
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: