Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get all filenames inside a folder in assets folder in android?

Tags:

android

How to get all filenames inside a folder in my assets folder in android? Please help. Thanks in advance.

like image 468
James Avatar asked Oct 15 '22 00:10

James


1 Answers

Get an AssetManager (using getAssets() from a context or activity), and call list("subdir") from it(replacing subdir with the name of the folder inside your assets folder).

That will get you a String[] with all the filenames you seek.

like image 199
Hostile Avatar answered Oct 18 '22 23:10

Hostile