I've been using the Activity.AddMenuItem for over 20 releases of my app. The latest compile no longer seems to allow the menu to open when the Android menu button is pressed. I tried it on 7 different device with same result. Not certain what I changed to disable the standard Android menu event in the app. With keyboard click on, pressing the menu button highlights the button (three vertical dots in most cases) and gives me a keyboard click, but the menu will not pop up.
I added a button and had it call the Activity.OpenMenu function and the menu opens fine. Any idea what would cause the app to stop processing the menu button event?
Sorry, I won't address specifically to you in future!
You can load the app from the google Play store... It is called Brew-Boss.
When pressing the 3 vertical dot menu button, the background of the 3 button turns light gray (indicating the OS sees the press?), the OS does an audible click, but the menu never pops up.
Are you using Appcompat? I had similar issue with the overflow button. It was audible only. I had input .noactionbar in the manifest for appcompat and by removing it, the overflow started to work again.
No, I am not using Appcompat. What I can't figure out is what changed. I think it got broken after installing the most recent B4A, but I can't be certain. It always worked before.
Responding to your question made me think. I loaded an older version of the app and compiled it with the latest B4A. The menu button works fine.
I did notice though, that the menu in that version pops up as two rows while the latest version when I open the menu using Activity.OpenMenu only shows it is 1 row (see pictures).
I do recall I had to make a change to the manifest to force an older SDK requirement (min=4) to eliminate a problem I had with the new version of B4A. When I compiled the app the screen objects took on an entirely new look and the screen looked terrible. I attache that pic as well. Also, that version did not show the vertical 3 dod menu button (see picture). Researching that, I found that I needed to roll the targetsdkversion back so I moved it back to version 5. That restored the 3 dots menu button but the menu won't open.
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/> (This in manifest shows the funky looking objects on screen and no menu button)
<uses-sdk android:minSdkVersion="1" android:targetSdkVersion="5"/> (This in manifest shows objects properly but menu button does not work?)
I'm not familiar with any issue in recent versions of B4A which is solved by setting the targetSdkVersion to 4 or 5. Actually your apps will be more reliable if you set it to 14.
On the 3 screenshots I showed, the Screenshot_2015-10-28-09-17-15.png one you can see the controls changed. The white backgrounds on the text, spinner, and label objects turned to horizontal lines under the cell. Thew only way I could find to fix that was to roll back the target SDK. If I leave it 14, all the objects loses their background and the menu button moves.
I changed the target SDK to 14 again and recompiled. The white backgrounds on the spinners and main prompt label go away and the menu moves to the upper right. That menu button does work. So I guess I have to look into the screen formatting with the loss of the white backgrounds.
I just noticed that I changed the main prompt window (where it says "Press Green Start Button to Begin Brewing") from a label to an edittext. So basically the spinners and edit text objects lose their white backgrounds when I use target sdk of 14?