开发者

how do i store a static html page in android emulator and later on view it from WebView while running?

how do i store a static html page in andr开发者_Python百科oid emulator and later on view it from WebView while running?


I think the best way for accomplish your task is to use the assets folder:

  • Create a toplevel folder named "assets"
  • Put your static html files there

Load the html file with somethinh like this:

...
browser=(WebView)findViewById(R.id.webkit);
browser.loadUrl("file:///android_asset/yourpage.html");
...


Here is a good example on how to load a static page into a WebView: http://code.google.com/p/apps-for-android/source/browse/trunk/Samples/WebViewDemo/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜