Android Question CLVTree clickable Item Text , How to retrieve the item Value

Mahares

Expert
Licensed User
Longtime User
The example I posted demonstrates it. You pass the index as the tag value of the clickable span.
If I have this code that shows that the clickable item index is i, how do you extract the text which is: Item &i in the Cs_Click sub
B4X:
For i = 1 To 10
        Dim cs As CSBuilder
        cs.Initialize.Underline.Append("test " & i).Color(xui.Color_Blue).Clickable("cs",  i).PopAll
        Dim item As CLVTreeItem = Tree.AddItem(Tree.Root, cs, Null, "")

B4X:
Private Sub cs_Click (Tag As Object)
    Log("cs click: " & Tag)
'How do you get the item text here is my question
End Sub
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
There are many ways to do it.
Here is one:
B4X:
cs.Initialize.Underline.Append("test " & i).Color(xui.Color_Blue).Clickable("cs", Array(i, "anything else you want here")).PopAll

Private Sub cs_Click (Tag As Object)
 Dim o() As Object = Tag
 Dim index As Int = o(0)
 Dim AnythingElse As String = o(1)
 
Upvote 0
Top