Hi:
I'm trying to find a element of a custom type in a list of them. As suggested in:
https://www.b4x.com/android/forum/threads/indexof-type.
I have a customlistview, and I've added a label with a trash to delete the item, a folder created and the element in the list to save in KVS
I've set the tag of the label to an element of my custom type:
And this is what I do when I press the trash:
I always get -1
Thanks
I'm trying to find a element of a custom type in a list of them. As suggested in:
https://www.b4x.com/android/forum/threads/indexof-type.
B4X:
Type TipoSite (Site As String, Tecnologia As String, TipoInstalacion As String, FechaChkl As String)
I have a customlistview, and I've added a label with a trash to delete the item, a folder created and the element in the list to save in KVS
I've set the tag of the label to an element of my custom type:
B4X:
LbTrash.Tag = CreateSite(Site,Tecnologia,Tipo)
And this is what I do when I press the trash:
B4X:
Sub LbTrash_click
Dim lbl As Label = Sender
Dim indexLista = -1 As Int
For index=0 To lista.Size-1
If lista.Get(index) = lbl.Tag Then
indexLista= index
End If
Next
Log(indexLista)
End Sub
I always get -1
Thanks