gpt4 book ai didi

带有子文件夹的 Android Assets

转载 作者:IT老高 更新时间:2023-10-28 22:16:33 25 4
gpt4 key购买 nike

InputStream myInput = myContext.getAssets().open("MyFolder/" + "MyFile.db3");

我在上面的子文件夹中的 Assets 文件夹中有一个文件。但是它没有获取文件,有没有特殊的方法可以在assets文件夹中指定一个子文件夹?

伊恩

最佳答案

编辑:关于子文件夹的错误。
此代码在 1.5 上运行良好(对于放置在 assetssub 文件夹下的文件 sample.txt):

InputStream is = getAssets().open("sub/sample.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String line = null;
while ((line = br.readLine()) != null) {
Log.e("wtf", line);
}
br.close();

你确定你的名字是对的吗?

关于带有子文件夹的 Android Assets ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3033902/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com