Question

I would like to call my menu from a custom button :

With targetversion<=10 this works fine with calling openOptionsMenu from onClick-Method of the button:

openOptionsMenu();

From targetversion>=11 this doesn't work.

Also to mention. With <=10 the Menuitem appears at the bottom:

enter image description here

With >=11 this icon disappeared.

Background : I like to have a targetversion=16. My app hides the TitleBar and Optionmenu appears in the Titlebar in Jelly Bean. Because of this I want to get rid of the google UI's changes every release, which costs a lot of developing/testing efforts every time. So I thought to have my own button which is GoogleApi independent.

Does anyone have any ideas or suggestions ?

regards

Was it helpful?

Solution

Are you sure you are calling openOptionsMenu() from an Activity? SDK documentation still mentions it as an active API. I double checked with <uses-sdk android:minSdkVersion="1" android:targetSdkVersion="17" /> and works just perfect.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top