I have an array declared as a button. I set the properties of the button in a loop and add them to a view. I need to know which button is pressed. How do I do this?
Here is my code:
Here is my code:
B4X:
Sub declareBtn
Dim btn(10) As Button
pnlList.Initialize("")
For i = 0 To 9
btn(i).Initialize("btn")
btn(i).Text = "btn" + i
btn(i).TextColor = Colors.White
pnlList.AddView(btn(i),10,10 + (i * 50),280,50)
End If
Next
end sub
Sub btn_Click()
'In here, I need to know which button is pressed.
End Sub