【发布时间】:2019-03-22 09:03:40
【问题描述】:
我正在使用 Assets 文件夹来存储文件。并添加了文件
十种方式
手动到这个文件夹。但是当我在这段代码的帮助下显示这个文件夹的文件列表时
AssetManager manager = getApplicationContext().getAssets();
try {
String[] files = manager.list("");
Toast.makeText(getApplicationContext(),files[0],Toast.LENGTH_SHORT);
} catch (IOException e) {
e.printStackTrace();
}
什么都没有显示。我知道这意味着这个文件夹中没有任何内容,但是为什么呢?
这是目录的结构:
【问题讨论】:
标签: android file android-studio directory android-assets