1

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?

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

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

That is because those folders do not exist. This is standard ZIP archive behavior, where "folders" are only designated as paths on files in the archive.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.