Android浏览器如何打开网页
16lz
2021-01-23
Android浏览器如何打开网页 文章分类:移动开发
一、打开链接
Intent it = new Intent(Intent.ACTION_VIEW, Uri.parse(" http://www.baidu.com"));
it.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
getContext().startActivity(it);
二、打开本地网页
Intent intent=new Intent();
intent.setAction("android.intent.action.VIEW");
Uri CONTENT_URI_BROWSERS = Uri.parse("content://com.android.htmlfileprovider/sdcard/123.html");
intent.setData(CONTENT_URI_BROWSERS);
intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
startActivity(intent);
一、打开链接
Intent it = new Intent(Intent.ACTION_VIEW, Uri.parse(" http://www.baidu.com"));
it.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
getContext().startActivity(it);
二、打开本地网页
Intent intent=new Intent();
intent.setAction("android.intent.action.VIEW");
Uri CONTENT_URI_BROWSERS = Uri.parse("content://com.android.htmlfileprovider/sdcard/123.html");
intent.setData(CONTENT_URI_BROWSERS);
intent.setClassName("com.android.browser", "com.android.browser.BrowserActivity");
startActivity(intent);
更多相关文章
- 指定浏览器访问指定页面(支持UC、Opera、QQ、Dolphin、Skyfire、
- TextView显示链接
- android点击邮箱链接跳转发送
- JS判断Android、iOS或浏览器的多种方法(四种方法)
- android 学习链接大集合
- Android 打开浏览器的几种方法
- Android的ContextMenu(上下文菜单)知识链接汇总