ACToolBarLight1.InitMenuListener
Sub Activity_CreateMenu(Menu As ACMenu)
Menu.Clear
Menu.Add(0, 0, "Blahblah", Null)
Menu.Add(1, 0, "Blahblahblah", Null)
End Sub
This is something I want to appear when the actionbar shows only sometimes. How can I hide the menu and unhide it again?
I´ve searched the forum, but wasn´t sure if the question was exactly the same, so please bare with me if that´s indeed the case.
Now you can call me lazy or a patient digger for simplicity or none of those. I could see stuff would be working with what you suggested but I wanted to keep changes to as few as possible: The more you change, the more can go wrong later.
So I suddenly figured out how simple it can be done.
In the globals, put something like:
B4X:
Dim menuon as boolean
Private ACToolBarLight1 As ACToolBarLight
Then set the createmenu event up like this:
B4X:
Sub Activity_CreateMenu(Menu As ACMenu)
Menu.Clear
If menuon = True Then
Menu.Add(0, 0, "w", Null)
Menu.Add(1, 0, "x", Null)
Menu.Add(2, 0, "y", Null)
Menu.Add(3, 0, "z", Null)
End If
End Sub
Then whenever you want the menu to appear, put this in your code: