Android Question Autocomplete edittext not showing items

jayel

Active Member
Licensed User
Longtime User
Hello,

Autocomplete edittextbox is filled with a list of items from a database table.
Code: Copy
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!

What am I doing wrong?

Greets,

John
 
DBUtils.ExecuteMemoryTable returns a List. Each item (row) in this list is an array of strings.
You should do something like:
Code: Copy
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)
 
Last edited:
Upvote 0
Back
Top