`
marine8888
  • 浏览: 540890 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

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

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics