Android Question [Solved] AutoCompleteEditText unintended selection list text color change

Frank.G

Member
Licensed User
Hi,

I use several AutoCompleteEditText views in my app and experience a strange problem when updating the field list.

I fill a list with data from an excel file and use setItems to fill the AutoCompleteEditText with the data from the list.

B4X:
Sub Activity_Create(FirstTime As Boolean)
LoadTable(File.Dirinternal, "3_lc.xls")
auto_3lc.SetItems(List1)
    
End Sub

Sub LoadTable(Dir As String, FileName As String)
    Dim workbook1 As ReadableWorkbook
    Dim sheet3lc As ReadableSheet
    workbook1.Initialize(Dir, FileName)
    sheet3lc = workbook1.GetSheet(0)
    List1.Initialize
    For row = 0 To sheet3lc.RowsCount - 1
        List1.Add(sheet3lc.GetCellValue(0, row))
    Next

End Sub
Everything is fine and the popup list when entering text into the field is white as supposed.
later in the software I reload the excel data (containing new info) into the list and update the AutoCompleteEditText.

B4X:
Sub some_Click
    LoadTable(File.DirInternal, "3_lc.xls")
    auto_3lc.SetItems(List1)
End Sub
From that point on the popup list of the AutoCompleteEditText is written in RED.
Any ideas what is needed to update the AutoCompleteEditText contents without influencing the color.

Thanks already

Frank
 

Frank.G

Member
Licensed User
The color isn't expected to change. Check your code. Maybe you are changing it somewhere?
Thank you Erel
TIL
That changing the AutoCompleteEditText.Textcolor to RED while typing also shows the list in RED but only after re-load of the list.
I wasnt aware because when a match was found the selected text turned to white again, but the list remained RED.
Some Setcolors to white at the correct places turned everything back to white.

Greetz
Frank
 
Top