I have the following problem. My listView's value is a special TYPE and what surprised me is that the listview automatically detects that the value is NOT a simple variable object and displays the key value because it is a string. Is there any way to set the displayed value explicitly?
Did you have a look at AddSingleLine2(Text As String, ReturnValue As Object) ?
With the Addxxx2 methods you can specify the text(s) and a specific return object.
Danke, Klaus! I didn't know this general explanation of "2" methods and was reading about them on demand.
Klaus, it seems I am wrong. I have implemented the Sub with the "2" method. Here is my code:
B4X:
Sub listAddItem(key As String, value As WORD)
listViewMain.AddSingleLine2(key, value)
If(Common.debug_mode) Then
Common.LogT("This is added: KEY(" & key & "), VALUE(" & value & ")", "")
End If
End Sub
Now, here is what I noticed:
if your value is String ==> listview display text = value
if your value is WORD and key is string ==> listview display text = key
if your value is WORD and your key is WORD => one of them is shown in some stringified way
I may not be correct but this is what I discovered.