Android的webview加载本地html、本apk内html和远程URL

1. [代码][Java]代码     

1
2
3
4
5
6
7
8
9
10
11
//打开本包内asset目录下的index.html文件
 
wView.loadUrl(" file:///android_asset/index.html ");  
 
//打开本地sd卡内的index.html文件
 
wView.loadUrl("content://com.android.htmlfileprovider/sdcard/index.html");
 
//打开指定URL的html文件
 
wView.loadUrl(" http://m.oschina.net");

转自:http://www.oschina.net/code/snippet_54100_6227

posted @ 2015-04-11 17:49  落七  阅读(5543)  评论(0)    收藏  举报