Can I create a menu out side the Activity_Create ??

farisnt

Member
Licensed User
Longtime User
Hi,
I need to create a menu when the Menu button is pressed, so there is a condition will run before creating the menu
the code
B4X:
If KeyCode=KeyCodes.KEYCODE_MENU Then
   If sock.connected=True Then Activity.AddMenuItem ("Disconnect","CloseConnection")
   Else
   Activity.AddMenuItem ("Connect","ConnectToServer")
   End If
End If

What I want is to change the Text for the menu before it appear
 

JonPM

Well-Known Member
Licensed User
Longtime User
The menu items should only be created in Activity_Create. If you need a custom menu there are some libraries available to do this.

Here is an older thread on the topic
 
Upvote 0
Top