List assets in a subdirectory using AssetManager.list

后端 未结 9 613
梦谈多话
梦谈多话 2020-12-04 23:37

My application has an assets directory in which I\'ve dumped a bunch of text files I need to load at runtime.

I have a directory full of assets of a particular type

9条回答
  •  爱一瞬间的悲伤
    2020-12-05 00:05

    When you need to have access to a folder down deeper in your hierarchy use

    String[] fileNames =getAssets().list("myFolder"+File.separator+"mysubfolder");
    

    instead of "/" inside the String, which would give you an empty String array as result.

提交回复
热议问题