There is no hardware button "Options", how to get the options menu?

I use this: android:theme="@android:style/Theme.NoTitleBar.Fullscreen" . The menu works great with devices that have the "Hardware Options" button at the bottom, menu items are displayed at the bottom of the screen.

How to make the "Options" button with a device that does not have this "hardware button"?

What I'm looking for:

See screenshot

If I turned off the (full-screen) style, the menu appears in the upper right corner, as expected.

+4
source share
3 answers

The fact that the "button" you are talking about in the screenshot is only available if your application has an SDK target below 11 in your manifest, because this is a compatibility trick for applications waiting for devices with the equipment and harbor menu button There was an update to use the action bar menu.

If you use the Action Bar menu, the expectation is that you are not hiding it from the user (at least forever).

+3
source

You are hiding an ActionBar that contains menu items when using this line

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

I'm not sure why you do this, but if you want them to show, do not use this Theme

0
source

Just change the target SDK to your manifest file on the target SDK 10:

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

And you will get a circular menu button with three dots in the lower right corner.

Also note that when updating apk you will have a problem with the game Google, google will not allow you to lower targetSdkVersion to the lower target

0
source

Source: https://habr.com/ru/post/1480406/


All Articles