I have a shipping Android application that displays occasional static webpages that are included in the assets folder. I have been displaying these programmatically like:
webView = new WebView(PKBDocument.KnowledgeBook.KBContext);
setContentView(webView);
webView.loadUrl("file:///android_asset/path/to the/file.html");
This works fine for API levels 3 - 9. I just recently received my shiny new Xoom and tried running the same app, and I get an error
The webpage at file:///android_asset/path/to%20the/file.html might be temporarily down or it may have moved permanently to a new web address
So, I started experimenting. The Honeycomb emulator displays these pages just fine, but my actual honeycomb device (running 3.0.1) consistently displays this error. I can read the webpage with AssetManager and then display it using loadDataWithBaseURL()
, but then the image links in the web page don't load (presumably because it can't find the path to the image file).
Any idea what changed, and how to handle this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…