Android Question [Solved] HowTo show a menu in Android 10?

opus

Active Member
Licensed User
Longtime User
I need to update my old app because my Samsung Tab10 updated.:(
Now it isn't showing the three dot (Hamburger?) menu anymore. I used this one to show a menu (see code below).
I there a suggested better way to show the menu? Create an own button?

Creating a menu item:
Activity.AddMenuItem(MyResources.GetApplicationString("NewGame"),"NewGame")
 

agraham

Expert
Licensed User
Longtime User
This works for me and gives a three vertical dots drop down menu at the top right on the title bar (or whatever it's correctly called).
B4X:
    Activity.AddMenuItem("Open ...", "mnuOpen")
    Activity.AddMenuItem("Save", "mnuSave")
    Activity.AddMenuItem("Save As ...", "mnuSaveAs")
    Activity.AddMenuItem("Clear", "mnuClear")
    Activity.AddMenuItem("Run ...", "mnuRun")
    Activity.AddMenuItem("Print", "mnuPrint")
    Activity.AddMenuItem("Add Line Nos.", "mnuAddNos")
    Activity.AddMenuItem("Remove Line Nos.", "mnuRemNos")
    Activity.AddMenuItem("Format Code", "mnuFormat")
    Activity.AddMenuItem("Font ...", "mnuFont")
    Activity.AddMenuItem("Font Size ...", "mnuSize")
    Activity.AddMenuItem("Tab Size ...", "mnuTabs")
    Activity.AddMenuItem("Help ....", "mnuHelp")
 
Upvote 0

opus

Active Member
Licensed User
Longtime User
Thanks for this reply, I haven't been precise enough.
Your code, which is basically the same as mine works on older devices. On the device in questions the
three vertical dots drop down menu
did show before the update, now (with Android 10 , One UI Version 2.1 Kernel 4.4.177-19000394) they are gone.

So how can I bring up the menu without those three dots?
 
Upvote 0

opus

Active Member
Licensed User
Longtime User
Thanks anyway. I think I'll start with an own button in the app for this.
 
Upvote 0

opus

Active Member
Licensed User
Longtime User
That was good hint, although the outcome is of a surprise to me!

My app uses
#IncludeTitle:false
, hence the three dots at the top do not show. On my (Samsung) devices this menu was always shown by long clicking either the left or rigth harware button. On the newest device (Samsung Tab A10 [SM-T150]) those hardware buttons were replaced by a virtual button line on the screen. On this line in addition to the three standard buttons the three dots appeared until the recent update.
In other words I missunderstood all your replys, SORRY FOR THAT.

My solution will most probable be to create a dedicated button on the screen, since I need as much space as available. I don't want to show the title just to have this button.

Thanks for the support!
 
Upvote 0

opus

Active Member
Licensed User
Longtime User
My solution will most probable be to create a dedicated button on the screen
That works on the older devices, the newer one without hardware buttons does show the menu only when the title is included. It looks to me as if the menu is part of the title (for this version).

[Edit:]
By the use of the StdActionBarHelper library I wass able to create a menu the pops up on all devices without showing a tile!
Done!
 
Last edited:
Upvote 0
Top