I have some media file in my asset folder. I want to get all media files names and files count from my asset folder.
Asked
Active
Viewed 5,897 times
1 Answers
8
A little googling might have helped you!
try this:
AssetManager assetManager = getAssets();
String[] files = assetManager.list("your_folder_name_inside_assets");
List<String> it = new LinkedList<String>(Arrays.asList(files));
TheMohanAhuja
- 1,815
- 2
- 19
- 30
Rat-a-tat-a-tat Ratatouille
- 6,729
- 4
- 27
- 40
-
There is a way to get the folder names that are in the assets folder? – JCarlosR Feb 07 '17 at 22:00
-
1Using an empty string it is possible to get the name of the folders in "assets" (but take a care; because it adds 3 additional folders: images, sounds and webkit). – JCarlosR Feb 07 '17 at 22:18