I hope I am posting this correctly. I am a B4A newbie and I'm sure it is something simple.
I have a layout with a listview that I am populating with a sqlite call. The SQL call works, I see the expected log messages. But the screen never update my listview with the new values. PopulateList gets called each time a spinner value is selected and a database insert is complete. So the listview is supposed to show the updated list to include the newest record.
What am I doing wrong?
I have a layout with a listview that I am populating with a sqlite call. The SQL call works, I see the expected log messages. But the screen never update my listview with the new values. PopulateList gets called each time a spinner value is selected and a database insert is complete. So the listview is supposed to show the updated list to include the newest record.
What am I doing wrong?
B4X:
Sub PopulateList()
Dim cur As Cursor
Dim sqlcmd As String
Dim linetext As String
sqlcmd = "SELECT col1, col2, col3 FROM table "
cur = Main.SQL.ExecQuery(sqlcmd)
For i = 0 To cur.RowCount - 1
cur.Position = i
linetext = cur.GetString("col1") & " : " & cur.GetString("col2")
ListView1.AddSingleLine(linetext)
Log("data=" & linetext)
Next
Log("all done")
End Sub