Android Question WildCardFilesList or File.ListFiles not working with SDK=29

gilsonmv

Member
Hey friends!
I use WildCardFilesList or File.ListFiles to display the file list.
With SDK up to 28 it works very well but if I change the SDK to 29 or higher, the following error appears:
"object should first be initialized (List)."
I'm using a cell phone with Android 10.
Is there any other command to display a list of files?

B4X:
Sub btFindMP3_Click
    Dim mShare As String
    XListView1.Clear
    
    rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
    If Result Then
        
    WildCardFilesList(File.DirRootExternal&"/music", ".mp3", True, True).Initialize
    Dim ml As List = WildCardFilesList(File.DirRootExternal&"/music", ".mp3", True, True)

        For l = 0 To ml.Size -1
            Log(ml.Get(l))
            XListView1.AddTextItem(Chr(0xf001)&"  "&ml.Get(l),ml.Get(l))
        Next

        XListView1.AsView.Visible = True
    End If
End Sub
 
Top