打开链接

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

 

相关文章:

  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2021-09-04
  • 2021-12-31
  • 2021-08-01
猜你喜欢
  • 2021-07-10
  • 2021-06-08
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2022-01-06
相关资源
相似解决方案