Android Question File.ListFiles only listing folders

Luthier

New Member
Licensed User
My app compiled with B4A 12.80, and running on a Samsung Tablet with Android 13, is supposed to list folders and files in a selected folder, but is only showing the folders.
Both File.ListFiles and File.ListFilesAsync do not show files within the selected folder.
I like the simplicity of the File.ListFile methods and hope that this can be fixed.
 
Solution
The problem is not in File.ListFiles. As @DonManfred wrote, the only accessible path is XUI.DefaultFolder = File.DirInternal

Use ExternalStorage to access external folders. You might need to copy the files before playing them.

If it is not a Google Play app then you can set the targetSdkVersion to 28.

DonManfred

Expert
Licensed User
Longtime User
What is the exact path you want to show/list? Depending in TargetSDK you are not able to access File.DirRootExternal-Paths
 
Upvote 0

Luthier

New Member
Licensed User
Thank you for your response.

My app is like a file finder app. I use it mainly for playing music stored as .MP3's. I realise that DirRootExternal folders are not accessible so I have tried to place the folders where my app is able to open the main music folder with a hundred or so album folders that I can see. However when I open them I get an empty list. In older versions of Android this worked fine.
The path to the main music folder is "/sdcard/Music/Music"

At present my app does not show files in any folder.. only the sub folders within the selected one. (When using File.ListFiles(dir) or the async version.)
 
Last edited:
Upvote 0

Luthier

New Member
Licensed User
Thank you Erel.
Not sending it to Google Play and App now showing files having set targetSdkVersion to 28.
 
Upvote 0
Top