开发者

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

开发者 https://www.devze.com 2023-02-01 08:29 出处:网络
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:

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

精彩评论

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