Android浏览器如何打开网页
16lz
2021-12-04
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);
更多相关文章
- Android获取打开各种文件Intent汇总
- Android(安卓)SDK Manager解决更新时的问题 :Failed to fetch URL
- Android(安卓)判断是否连接网络
- 指定浏览器访问指定页面(支持UC、Opera、QQ、Dolphin、Skyfire、
- Android(安卓)EditText 代码实现键盘弹出打开和关闭工具类
- Using Ant to Automate Building Android(安卓)Applications
- android 获取应用列表 点击打开应用
- TextView显示链接
- JS判断Android、iOS或浏览器的多种方法(四种方法)