我已经添加了apk扩展文件,并成功上传和下载,但无法使用
我的扩展文件包含图片,而上传我已经做了所有的压缩和上载..
下面是我从扩展文件中获取图像的代码...
有谁能帮帮我..我如何获取图像?
ZipResourceFile expansionFile = APKExpansionSupport
.getAPKExpansionZipFile(context, 1, 0);
// Get an input stream for a known file inside the expansion file
// ZIPs
InputStream is = expansionFile.getInputStream("95065668.jpg");
Log.d(TAG,
"Assigning obb image to preview image::::::::::::"
+ is.available());
BitmapFactory.Options bfo = new BitmapFactory.Options();
bfo.inPreferredConfig = Bitmap.Config.ARGB_8888;
Bitmap b = BitmapFactory.decodeStream(is, null, bfo);发布于 2012-12-05 15:03:06
差不多完成了,读取您的HTML文件并将其转换为UTF-8字符串。加载为(&L)
webview.loadData(ur_html_str, "text/html", null);其中ur_html是这样的:
String ur_html_str = "<html><body>youe body contents</body></html>";https://stackoverflow.com/questions/13717841
复制相似问题