Hello everyone, I have a tiny doubt about the correct sintax with MenuItem.
Im tryin to simplify my life a bit, with the menus, but today its not my lucky day.
So these are my methods
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Login")
InputLogin1.Hint = "Name"
Activity.Title ="Login"
AuxCode.Menu_Charge(Activity,Null) ''My aux methods
End Sub
''my menu constructor, in an Auxiliar module called auxCode
Sub Menu_Charge(Act As Activity, status As String)
Act.AddMenuItem("About", about_Click)
(...)
EndSub
'The click Method
Sub about_Click
Msgbox("Version X", "MyAPP")
End Sub
The behaviuour with this code block is that when activity starts the msgbox is shown ( so if its called 7 times, the msgbox its shown 7 times)
So, Surfing through the forum, I´ve see that the ''best way or correct'' syntax is with callsubdelayed, but when I write :
Act.AddMenuItem("About", CallSubDelayed(something, "about_Click"))
1st Something needs to be a component, but i do not understand which component should be there.
Anything i write, :: B4A tells that I cant assing this to an empty value.
My question is, if is not a syntax error ( that i beg it is... ) , it is possible to create the menus by this way, or it is preffered to use a button and a spinner by my own way.
Kind Regards,
MsB