Search code examples
menubasic4android

Implement global menu in Basic4android


I am developing an application that has many activities. Is there any way to implement the same menu to all activities?


Solution

  • You can use a code module to create the menu.

    Sub CreateMenu(Act As Activity)
        Act.AddMenuItem("m1", "m1")
        Act.AddMenuItem("m2", "m2")
        Act.AddMenuItem("m3", "m3")
    End Sub
    

    You can then call this method from other activities. The events will be handled in each activity.