Autocomplete edittextbox is filled with a list of items from a database table.
B4X:
Dim ToestelList As List
ToestelList.Initialize()
ToestelList = DBUtils.ExecuteMemoryTable(Main.mySQL,"Select toestelnaam from toestel order by toestelnaam",Null,0)
ACtxtToestel.SetItems(ToestelList)
' 'ACtxtToestel.Initialize("")
' ACtxtToestel.SetItems(Array As String("aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh"))
ACtxtToestel.InputType = ACtxtToestel.INPUT_TYPE_TEXT
But when I type it doen't show me the suggestion.
When I fill with an array of strings it works!
DBUtils.ExecuteMemoryTable returns a List. Each item (row) in this list is an array of strings.
You should do something like:
B4X:
Dim str(ToestelList.Size) As String
For i = 0 To str.Length - 1
Dim cols() As String = ToestelList.Get(i)
str(i) = cols(0)
Next
ACtxtToestel.SetItems(str)