3

I have an activity with full-screen mode

  android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 

and I used button to open the option menu

dmenu.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                openOptionsMenu();

            }
        });

but when I click the button no thing happens

when I delete the full-screen theme all things work will so I can Open the menu from my button and from tablet soft menu button

how can I open the menu from my button and with full-screen mode

2 Answers2

3

I had the same problem. I fixed it by putting the targetSdkVersion in AndroidManifest.xml to a version prior to 11 like this :

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="10"/>

By doing this, it works and the call to openOptionsMenu() does work

vince
  • 31
  • 2
  • 1
    In my application, using the fullscreen theme, onCreateOptionsMenu was never called. This fix works for me too..but where is this documented?? – hara Sep 24 '14 at 13:46
-1

This question is already answered here Android Option Menu on Button click

Community
  • 1
  • 1
MRX
  • 1,400
  • 3
  • 12
  • 32