I want to write a sub that will traverse a ListView and I need to be able to access the items in it. I don't know ahead of time how the rows were added. Let's say it used:
which is from the ListView tutorial https://www.b4x.com/android/forum/threads/listview-tutorial.6537/
Ok, now I have to traverse it and access the items. How do I know item#10 is TwoLines or SingleLine or TwoLinesAndBitmap?
Here is the loop where I need to access the items in the ListView.
TIA
B4X:
Dim Bitmap1 As Bitmap
Bitmap1.Initialize(File.DirAssets, "button.gif")
For i = 1 To 300
ListView1.AddSingleLine("Item #" & i)
ListView1.AddTwoLines("Item #" & i, "This is the second line.")
ListView1.AddTwoLinesAndBitmap("Item #" & i, "This is the second line.", Bitmap1)
Next
which is from the ListView tutorial https://www.b4x.com/android/forum/threads/listview-tutorial.6537/
Ok, now I have to traverse it and access the items. How do I know item#10 is TwoLines or SingleLine or TwoLinesAndBitmap?
Here is the loop where I need to access the items in the ListView.
B4X:
For i=0 To aListView.Size-1
Private locObj As Object
locObj = aListView.GetItem(i)
Log(GetType(locObj)) 'Displays as JavaString
'How do I determine if locObj has 1 label, 2 labels or 2 labels and a bitmap? And how do I access them in this loop?
next
TIA