I'm trying to get the names of my folders in "assets". I can get the names of the files with an AssetManager by using the method assetManager.list(). But the problem is that it return only files' name and not folders' names. So I'm trying to use the listFiles() method but i can't access to the Assets directory; I've try the following :
File di开发者_开发知识库r = new File ("file:///android_asset/");
File[] files= dir.listFiles();
But it doesn't work :( ... Is there a way to get the folders' names contained in the Assets directory ?
The URL "file:///android_asset/" doesn't point to a particular directory, it is only used by WebView to address assets. Assets are read-only and defined at compile time, so it's assumed their directory structure is known to the programmer. It's inconvenient, but that's the way it's designed
精彩评论