ITeye博客

Android浏览器如何打开网页

marine8888 · 2011-01-29 19:12 · Android——网络相关 · 移动开发 · Markdown

一、打开链接 

 

        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);

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。