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

Android浏览器如何打开网页

2011-03-21 12:15 176 查看
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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: