Android Question Why does Menu button show?

canalrun

Well-Known Member
Licensed User
Longtime User
Hello,
I am using the Osmdroid library version 3.6 in an app that I originally wrote several years ago. It works great so there's no need to upgrade to the new version.

I noticed today, for the first time, that there is an extra menu icon:

upload_2019-6-25_21-44-31.png


The one circled on the left is an icon for a sliding menu that I create. I just noticed today that there is also a second menu icon on the right! I've never seen that before – maybe it's because I just started using Android 7.0 in my LG G6 or maybe I just need glasses. My other apps don't show a second menu button.

Is this something I'm doing? Is there a way to delete it? It's not worth spending any time at all debugging it, but if you know off the top of your head, it might be nice for me to fix it.

Barry.
 

canalrun

Well-Known Member
Licensed User
Longtime User
The plot thickens…

Apparently that button with the three bars toward the upper right on the picture of my LG G6 running Android 7.0 above is called a "Home Touch Button". LG describes Home Touch Buttons, but does not mention this Menu button.

My LG G4 running Android 6.0 does not have this button appear running the same app.

No other applications on my G6 cause this button to appear (there are just the three buttons shown below the Menu button, as expected).

The reason pressing this Home Touch Menu Button causes my app signing menu to open is because of the following software. (Note: depressing this Home Touch Menu Button causes the KEYCODE_MENU code to be sent to my app.)

B4X:
  If (KeyCode = KeyCodes.KEYCODE_MENU) Then
    btnMenu_Click ' open sliding menu
    Return True ' Consume event, so the app does not close

I must be doing something to cause this Home Touch Menu Button to suddenly appear, but I have no idea what it could be.

Google searching hasn't uncovered anything. Anyone have any ideas?

Barry.
 
Upvote 0

canalrun

Well-Known Member
Licensed User
Longtime User
I must be doing something to cause this Home Touch Menu Button to suddenly appear, but I have no idea what it could be.
Barry.

Makes sense now!

I found the answer at: https://android-developers.googleblog.com/2012/01/say-goodbye-to-menu-button.html

In Nougat (Android 7.0 and higher) they remove the hard Menu button and replace it with Recent apps/Multi-screen. To compensate for legacy apps they add a Menu button to the home button bar.

Setting targetSDKVersion 11 or above keeps Android from considering the app "legacy" and does not add the Menu button.

upload_2019-6-27_22-58-41.png


Barry.
 

Attachments

  • upload_2019-6-27_22-57-51.png
    upload_2019-6-27_22-57-51.png
    118.4 KB · Views: 156
Last edited:
Upvote 0
Top