android_asset 不适用于 Honeycomb? [英] android_asset not working on Honeycomb?

查看:15
本文介绍了android_asset 不适用于 Honeycomb?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个发布的 Android 应用程序,它偶尔会显示资产文件夹中包含的静态网页.我一直在以编程方式显示这些:

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

这适用于 API 级别 3 - 9.我最近收到了闪亮的新 Xoom 并尝试运行相同的应用程序,但出现错误

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

位于 file:///android_asset/path/to%20the/file.html 的网页可能暂时关闭,或者它可能已永久移动到新网址

于是,我开始尝试.Honeycomb 模拟器可以很好地显示这些页面,但我的实际蜂窝设备(运行 3.0.1)始终显示此错误.我可以使用 AssetManager 读取网页,然后使用 loadDataWithBaseURL() 显示它,但是网页中的图像链接无法加载(大概是因为它找不到图像文件的路径)).

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?

推荐答案

尝试删除空格.这个项目这个项目 在我的 XOOM 上都运行良好.

Try removing the space. This project and this project both work fine on my XOOM.

这篇关于android_asset 不适用于 Honeycomb?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆