Android Question CustomListView - How to handle button clicks?

jtare

Active Member
Licensed User
Longtime User
Hi, Im trying to use buttons in my Custom List View but I could not figure out how to handle the clicks, I will like to know from what item position the click come from, so I can take the action required to that item position.
Is this posible?

Screenshot_2016-08-05-19-49-38.png
 

mangojack

Expert
Licensed User
Longtime User
?? .. the downloaded class example contained a button click code.

If you have added the button in Designer to clv layout ... EventName property = Button1
B4X:
Sub Button1_Click
    Dim index As Int = clv1.GetItemFromView(Sender)
    Dim pnl As Panel = clv1.GetPanel(index)
    Log($"Item Index = ${index}   Item value = ${clv1.GetValue(index)}"$)
End Sub


If you have added the clv views in code .. ensure you have set the EventName in Button1.Initialize("Button1")
 
Last edited:
Upvote 0
Top