hi all,
Am copying some files from dirassets to dirdefaultexternal . I can see the files in filemanager once copied.
Then, i am trying to show those files in a listbox using following code..
also tried
but in both cases no files are returned in the list...does file.ListFiles not work on dirDefaultExternal ?
if not..what other way to get filelist from that folder?
regards
carloz
Am copying some files from dirassets to dirdefaultexternal . I can see the files in filemanager once copied.
Then, i am trying to show those files in a listbox using following code..
B4X:
Sub ListFolderContent(folder As String) As String
Dim fileList As List
Dim n As Int
fileList = File.ListFiles(root)
fileList.Sort(True)
For n = 0 To fileList.Size-1
file1 = fileList.Get(n)
If(file1.Contains(".mp4")) Then
ListView1.AddSingleLine(file1)
End If
Next
End Sub
also tried
B4X:
Sub ListFiles(dir As String)
Dim list_files As List
Dim lista_folders As List
lista_folders.Initialize
list_files=File.ListFiles(dir)
For i= 0 To list_files.Size -1
If File.IsDirectory(dir, list_files.Get(i))=False Then
lista_folders.Add(list_files.Get(i))
End If
Next
Return lista_folders
End Sub
but in both cases no files are returned in the list...does file.ListFiles not work on dirDefaultExternal ?
if not..what other way to get filelist from that folder?
regards
carloz