Android Question button event

Andie

Member
Licensed User
Longtime User
After a break of several months, I resume working with B4A. I'm very ashamed and angry about myself that I'm not able to detect the most simple click event:
B4X:
Sub Activity_Create(FirstTime As Boolean)

btnOkay.Initialize("btnOkay_click")
Activity.AddView(btnOkay,50%x,50%y,30%x,45dip)
btnOkay.Text = "okay"

End Sub

Sub btnOkay_click
    Msgbox ("button pressed", "success")
End Sub

Of course, I did define Dim btnOkay As Button in Sub Globals. What is wrong???
 

TheJinJ

Active Member
Licensed User
Longtime User
btnOkay.Initialize("btnOkay")

After a break of several months, I resume working with B4A. I'm very ashamed and angry about myself that I'm not able to detect the most simple click event:
B4X:
Sub Activity_Create(FirstTime As Boolean)

btnOkay.Initialize("btnOkay_click")
Activity.AddView(btnOkay,50%x,50%y,30%x,45dip)
btnOkay.Text = "okay"

End Sub

Sub btnOkay_click
    Msgbox ("button pressed", "success")
End Sub

Of course, I did define Dim btnOkay As Button in Sub Globals. What is wrong???
 
Upvote 0
Top