Android Question How to list a specific folder with dialogs

Daniel-White

Active Member
Licensed User
Longtime User
Hello folks.

How can I used the dialog library to show a specific folder an example the folder DCIM
I would like to list the files of a specific folder, I don't know how with fd.filepath etc.

Thanks you so much.


B4X:
Sub btnFile_Click
    Dim fd As FileDialog
    fd.FastScroll = True
    'fd.ShowOnlyFolders = True
    fd.FilePath = File.DirRootExternal ' also sets ChosenName to an emtpy string
    'fd.ShowOnlyFolders = true
    'fd.FileFilter = ".txt" ' for example or ".jpg,.png" for multiple file types
    ret = fd.Show("B4A File Dialog", "Yes", "No", "Maybe", Bmp)  
    ToastMessageShow(ret & " : Path : " & fd.FilePath & CRLF & "File : " & fd.ChosenName, False)  
End Sub
 

Daniel-White

Active Member
Licensed User
Longtime User
Hello folks.

How can I used the dialog library to show a specific folder an example the folder DCIM
I would like to list the files of a specific folder, I don't know how with fd.filepath etc.

Thanks you so much.


B4X:
Sub btnFile_Click
    Dim fd As FileDialog
    fd.FastScroll = True
    'fd.ShowOnlyFolders = True
    fd.FilePath = File.DirRootExternal ' also sets ChosenName to an emtpy string
    'fd.ShowOnlyFolders = true
    'fd.FileFilter = ".txt" ' for example or ".jpg,.png" for multiple file types
    ret = fd.Show("B4A File Dialog", "Yes", "No", "Maybe", Bmp)
    ToastMessageShow(ret & " : Path : " & fd.FilePath & CRLF & "File : " & fd.ChosenName, False)
End Sub

Well, my understanding we cannot use this lib for that, we can use this class of our friend Informatix https://www.b4x.com/android/forum/threads/class-file-explorer-with-visualization.19003/#content

Thanks. I hope this can help others.
 
Upvote 0
Top