Android Question Menus between activities

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Hi,
Any way of having a menu definition in one module and use it in all the activities of the app?

And where can I found the icon of this menu?
Are they an android resource I can use? see image.

Thanks
 

Attachments

  • 2015-06-04_0730.png
    2015-06-04_0730.png
    56.4 KB · Views: 115
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can use a class to add the menu items (pass the activity as a parameter to the class). The menu click event will still fire on the activity module. You can use a single event for all the menu items and then delegate it to the class. This will allow you to share the code between all the modules:
B4X:
Sub Menu_Click
 MenuHandlerClassInstance.MenuClick(Sender) 'sender will be the menu text
End Sub
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
It is this or I need to add the menu, items and click code in all the activities?
Thats what you normally do?
May exists a compiler INCLUDE(file) to include the same code in many modules?
 
Upvote 0
Top