一、启动android默认浏览器
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");//Intent.ACTION_VIEW
Uri content_url = Uri.parse("http://www.cnblogs.com");
intent.setData(content_url);
startActivity(intent);
这样子,android就可以调用起手机默认的浏览器访问。
如果安装了多个浏览器
二、指定相应的浏览器访问
1、指定android自带的浏览器访问
(“com.android.browser”:packagename;“com.android.browser.BrowserActivity”:启动主activity)
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
Uri content

本文介绍了如何在Android中使用Intent打开浏览器并指定访问特定网页。内容包括使用默认浏览器、指定Android内置浏览器和其他第三方浏览器(如UC、Opera、QQ浏览器)的方式。此外,还详细讲解了如何打开本地html文件,以及如果需要支持file协议,需要在Android源码中修改manifest.xml并重新编译。
最低0.47元/天 解锁文章

667

被折叠的 条评论
为什么被折叠?



