打开链接

打开链接

  1.         Intent it = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.baidu.com"));  
  2.         it.setClassName("com.android.browser""com.android.browser.BrowserActivity");  
  3.         getContext().startActivity(it);  

 

打开本地网页

 

  1. Intent intent=new Intent();   
  2. intent.setAction("android.intent.action.VIEW");   
  3. Uri CONTENT_URI_BROWSERS = Uri.parse("content://com.android.htmlfileprovider/sdcard/123.html");   
  4. intent.setData(CONTENT_URI_BROWSERS);   
  5. intent.setClassName("com.android.browser""com.android.browser.BrowserActivity");   
  6. startActivity(intent);  
posted @ 2014-03-17 17:51  罗小姿  阅读(381)  评论(0编辑  收藏  举报