Is it possible to sort the putput of a treeview that shows directorys ?
Here is the code thats belong to that:
I followed Erel Tut but found no answer or hint
Here is the code thats belong to that:
B4X:
Sub recursiveFolder(tr As TreeItem,folder As String)
Dim l As List = getFolders(folder)
If l.Size = 0 Then
Dim tr2 As TreeItem
tr2.Initialize("","{Empty}")
tr.Children.Add(tr2)
Return
End If
For i = 0 To l.Size - 1
Dim tr2 As TreeItem
tr2.Initialize("tr",l.Get(i))
tr.Children.Add(tr2)
If File.IsDirectory(folder,l.Get(i)) Then
recursiveFolder(tr2,folder&"\"&l.Get(i))
End If
Next
End Sub
private Sub getFolders(folder As String) As List
Dim l As List = File.ListFiles(folder)
Dim lreturn As List
lreturn.Initialize
For i = 0 To l.size - 1
Dim fName As String = l.Get(i)
' If File.IsDirectory(folder,fName) Then
lreturn.Add(fName)
' End If
Next
Return lreturn
End Sub
I followed Erel Tut but found no answer or hint