I am retrieving files from a folder and placing the items in a list:
B4X:
Dim fileList As List
Dim fileCount As Int
fileList = File.ListFiles(File.DirRootExternal & "/Pictures/")
fileCount = fileList.Size
Log("File List = " & fileList)
Log("File Count = " & fileCount)
The Log is:
B4X:
File List = (ArrayList) [IMG_20160901_134832.jpg, IMG_20160901_135028.jpg]
File Count = 2
How do I:
Extract the File Name as a String.
Extract the Image.
Once I have the individual components, I can load into a ListView (ULV)
Dim FileList As List
FileList = File.ListFiles(File.DirInternal)
Dim ListImage As List
ListImage.Initialize
For i = 0 To FileList.Size-1
Dim FileName As String = FileList.Get(i)
If FileName.Contains(".jpg") Then
Dim img As Bitmap = LoadBitmap(File.DirInternal,FileName)
ListImage.Add(img)
End If
Next
After that, with a listview, you can do something like:
B4X:
For i = 0 to ListImage.size - 1
LstView.AddTwoLinesAndBitmap("Text","Text",ListImage.get(i))
Next