Android Question label.tag in customlistview

gregorio_adrian_gimenez

Active Member
Licensed User
Longtime User
Hi! I have a customlistview loaded with a label. Using the label_click function I would like to retrieve information saved in label.tag, specifying the customlistview index.
Can this be done? how would it be? I thank everyone regards
 

Mahares

Expert
Licensed User
Longtime User
Using the label_click function I would like to retrieve information saved in label.tag, specifying the customlistview index.
Perhaps something like this:
B4X:
Sub Label_Click  'all 4 labels in same panel have Label as event name in designer
'    Log(CustomListView1.Size)
    Dim v As B4XView=Sender   
    Log(v.Text)  'text of label clicked
    LogColor(v.tag, Colors.Red)    'tag of label clicked
    Dim index As Int = CustomListView1.GetItemFromView(Sender)
    Log($"Item: ${index}"$)     'index of customlistview item corresponding to the clicked label 
    Log("-----")
End Sub
 
Upvote 0
Top