Hi there.
I would like to use a single Event which is triggered when a button on the menu has been pressed. Unfortunately, I am unable to understand how to get the Sender.
I am doing this for the sake of simplifying my code via a central method in a Code Module and I want to handle a single click event in all Activities.
I would like to use a single Event which is triggered when a button on the menu has been pressed. Unfortunately, I am unable to understand how to get the Sender.
B4X:
Sub addMenus()
Activity.AddMenuItem("About","menu")
Activity.AddMenuItem("Next One","menu")
Activity.AddMenuItem("Third","menu")
End Sub
Sub menu_Click()
Dim a as [WHAT]
a = Sender
' if I manage to extract the value it would be much better.
' Here I will do a Select Case of the values and Start the corresponding Activity.
End Sub
I am doing this for the sake of simplifying my code via a central method in a Code Module and I want to handle a single click event in all Activities.
Last edited: