Android Question Why does Menu button show?

Discussion in 'Android Questions' started by canalrun, Jun 26, 2019.

  1. canalrun

    canalrun Well-Known Member Licensed 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.
     
  2. canalrun

    canalrun Well-Known Member Licensed 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.)

    Code:
    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.
     
  3. canalrun

    canalrun Well-Known Member Licensed User

    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.
     

    Attached Files:

    Last edited: Jun 28, 2019
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice