我得到除了当我尝试打开res/raw
文件夹中的文件。Android开发,原始资源无法找到
InputStream in = Resources.getSystem().openRawResource(R.raw.eng_sample);
唯一的例外是:
android.content.res.Resources$NotFoundException: Resource ID #0X89890
我可以看到该文件eng_sample.txt
在APK中res/raw/eng_sample.txt
。
最重要的是,当我做R.raw.
并按Ctrl-space
文件eng_sample
作为建议给出。
然后是什么问题?我该如何解决?
非常感谢提前。
P.S.
我也尝试把文件eng_sample.txt
纳入main/assets
。然后提取文件与
InputStream in = context.getAssets().open("file:///android_asset/eng_sample.txt
但现在我得到一个IO异常。
也许有人可以告诉我如何使这种方法工作,而不是上面的那个?