Android资产没有价值读取? [英] Android Assets No Value Read?
本文介绍了Android资产没有价值读取?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
AssetManager assets = myContext.getAssets();
String[] files = assets.list("MyFolder");
InputStream myInput = assets.open("MyFolder/" + files[0]);
int i = myInput.read();
在这种情况下,"i"为-1,表示未读取任何内容.
in this case 'i' is -1 meaning nothing read.
如果文件在那里,为什么什么也没有,变量'files'也有文件.
Why would nothing be there if the file is there, the variable 'files' has the file as well.
我是否需要对放入Assets文件夹中的文件进行任何处理才能使其可读?
Do I need to do anything to the file I put into the Assets folder in get it to be readable?
注意:当我使用一个小的文本文件时,它可以工作.当我使用10兆的文件时,它不会. (10兆是我需要安装的Sqlite数据库)
推荐答案
将文件重命名为XXXXXX.png,以便不进行压缩,然后可以将其复制.
Rename the file to XXXXXX.png so that it is not compressed, then it can be copied over.
这篇关于Android资产没有价值读取?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文