[英]'The file name must end with .xml' when i try to read the value from text file(.txt) inside the assets folder
I'm trying to read the value from the text file(.txt), which is inside the assets
folder, when I try to rebuild the project, I'm getting this error, how to solve this?我正在尝试从
assets
文件夹内的文本文件(.txt)中读取值,当我尝试重建项目时,出现此错误,如何解决?
The file name must end with .xml
this is the java code, I'm trying to read the value from the text file,这是java代码,我正在尝试从文本文件中读取值,
try {
InputStream is=getAssets().open("english.text");
int size=is.available();
byte[] buffer=new byte[size];
is.read(buffer);
is.close();
line=new String(buffer);
} catch (IOException e) {
e.printStackTrace();
}
You have the assets\/<\/code> directory in the wrong place.
您将
assets\/<\/code>目录放在错误的位置。
It needs to directly under
main\/<\/code> , as a peer of
java\/<\/code> and
res\/<\/code> .
它需要直接在
main\/<\/code>下,作为
java\/<\/code>和
res\/<\/code>的对等点。
"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.