Android Question Android menu no longer opens

flyingpole

Member
Licensed User
Longtime User
Erel,

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?

Thanks in advance.
 

flyingpole

Member
Licensed User
Longtime User
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.

Screen shot of the activity attached.

Thanks
 

Attachments

  • Screenshot_2015-10-28-07-51-08.png
    Screenshot_2015-10-28-07-51-08.png
    134.5 KB · Views: 135
Upvote 0

Scantech

Well-Known Member
Licensed User
Longtime User
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.
 
Upvote 0

flyingpole

Member
Licensed User
Longtime User
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.
 
Upvote 0

flyingpole

Member
Licensed User
Longtime User
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?)

Any help in figuring this out is appreciated
 

Attachments

  • Screenshot_2015-10-28-09-10-54.png
    Screenshot_2015-10-28-09-10-54.png
    148.9 KB · Views: 138
  • Screenshot_2015-10-28-09-11-44.png
    Screenshot_2015-10-28-09-11-44.png
    149.5 KB · Views: 153
  • Screenshot_2015-10-28-09-17-15.png
    Screenshot_2015-10-28-09-17-15.png
    133.5 KB · Views: 137
Upvote 0

flyingpole

Member
Licensed User
Longtime User
Here is a picture showing the menu button being pressed, it's background turns light gray and the OS does give a keyboard click audible notification.
 

Attachments

  • Screenshot_2015-10-28-09-24-43.png
    Screenshot_2015-10-28-09-24-43.png
    136.5 KB · Views: 143
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/> (This in manifest shows the funky looking objects on screen and no menu button)
The menu has moved to the top right corner (this is an Android design change). Does it work when you click on that button?

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
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.
 
Last edited:
Upvote 0

flyingpole

Member
Licensed User
Longtime User
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.
 
Upvote 0

flyingpole

Member
Licensed User
Longtime User
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.
 
Upvote 0

flyingpole

Member
Licensed User
Longtime User
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?
 
Upvote 0

flyingpole

Member
Licensed User
Longtime User
I tried that I changed to:

SetApplicationAttribute(android:theme, "@android:style/Theme.Light")

Everything looks great, except the menu button goes away completely...not on bottom, upper right, etc.???
 
Upvote 0
Top