Android Question Need help with corwin42’s example “Material Design 4 - Modifyable and advanced Menu”

Dread

Member
Licensed User
Longtime User
I have added Menu.AddSubMenu(4,4,6,"SubMenu") to the Activity_CreateMenu sub in corwin42’s example and want clicking “SubMenu” to redisplay the menu with submenu items. How can this be achieved? Any help would be greatly appreciated.
 

DonManfred

Expert
Licensed User
Longtime User
Add the submenuitems to the newly created submenu.

B4X:
Dim smSubmenu As ACSubMenu
smSubmenu = NavDrawer.NavigationView.Menu.AddSubMenu(4,4,6,"SubMenu") ' Remeber the submenu created/created by AddSubMenu...
smSubmenu.AddWithGroup2(1, miUpgrade, 1001, "Upgrade", xml.GetDrawable("ic_account_circle_black_24dp")).ItemCollapsed=True ' add item to the new submenu
 
Upvote 0

Dread

Member
Licensed User
Longtime User
Thank you DonManfred. Corwin's example "material Material Design 4 -Modifyable and advanced Menu" displays a menu when an overflow icon is clicked on a Toolbar.
and not a NavDrawer. How do I modify your code? While I have been a member for a few years now, I am still very much a beginner at programming.
 
Upvote 0

Dread

Member
Licensed User
Longtime User
Hooray! After several attempts at modifying your code and coming back to it later in the day, I finally work it out. A sincere thanks DonManfred for you help.
 
Upvote 0
Top