[转载]Android 打开链接 – 罗小姿 – 博客园

[转载]打开链接 - 罗小姿 - 博客园.

利用外部浏览器,打开互联网站链接
[java]

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);
[/java]

打开本地存储网页
[java]
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);
[/java]