Submenus

Former Member
Former Member
Am I missing a way to define a submenu (or even a 2nd menu) in XML? I tried adding a second menu to my menu.xml file and it won't compile. I tried adding a second XML file with the second menu and it doesn't find it at runtime. I even tried adding a line for my submenu file in the resources.xml file and tried using Ui.loadResource(). Nothing I have done has made my second menu available.

The only sample, Attention, that I have found to contain a menu has just one level (at least in XML).

I still haven't figured out why one menu named MainMenu is available at runtime regardless of the name of the xml file. Eclipse automatically added menu.xml with a MainMenu when it created my project and it is listed in the menu delegate. I cannot access my menu in a second XML file the same way.

Do I have to define submenus in code?
  • Why not define two different menus like:

    <menu id="MainMenu">
    <menu-item id="item_1">One</menu-item>
    <menu-item id="item_2">Two</menu-item>
    <menu-item id="item_3">Chose in Three menu</menu-item>
    </menu>

    <menu id="MenuItem3">
    <menu-item id="item_3a">3a</menu-item>
    <menu-item id="item_3b">3b</menu-item>
    </menu>


    Yes, you have to manage this in your code, but should do what you want...