简体   繁体   中英

Get list of folders from assets folder

I'm trying to load files from assets folder. Assets folder contains two folders dir1, dir2 and file file1. I'm using following code:

AssetManager am = getAssets();

String[] data = null;
try {
    data = am.list("");
} catch (IOException e) {
    e.printStackTrace();
}

This gives me following output: sounds, images, webkit, file1 . Anyone knows how to list folders dir1, dir2?

PS If I do data = am.list("dir1"); it shows me files, that located in dir1.

It is appeared that folders were empty, and method AssetManager.list(""); doesn't return empty folders.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM