android - show menu button on galaxy nexus

15,966

Solution 1

The Menu button has been deprecated in ICS. Your options are 1) run in legacy mode (targetSdkVersion < 14), 2) use an action bar with or without an overflow menu button, 3) add a menu button somewhere in your app area. 4) not using a menu and just adding its actions directly to your app area.

Solution 2

The menu button is more of a legacy thing on newer Android phones with bigger screens since it's normally best to use the Action Bar (1) to provide the user with the actions that would normally be on the menu. These are called "Action Items" and are a better user experience because they appear directly on the Action Bar rather than requiring the user to tap the menu button.

(1) http://developer.android.com/guide/topics/ui/actionbar.html

Share:
15,966
android developer
Author by

android developer

Really like to develop Android apps &amp; libraries on my spare time. Github website: https://github.com/AndroidDeveloperLB/ My spare time apps: https://play.google.com/store/apps/developer?id=AndroidDeveloperLB

Updated on June 11, 2022

Comments

  • android developer
    android developer almost 2 years

    i need to have the menu button shown for some activities on galaxy nexus . i can't find how to do that, since it hides it by default . i don't wish to create an action bar since it takes more space that i want to use to other things . when setting the "android:targetSdkVersion" value to lower than 14 , it seems to show the menu button , but otherwise, it hides it . btw, the activity needs to be full screen , with no title/action bars .

    it is very weird that this button is not shown by default for so many places (even the launcher) , and on some places it does exist . such a button is a very basic one for so many android devices . google decided that not only that , but instead , the switching button is more important to be shown and it's shown by default (no idea if it's possible to hide it, but i guess not , since home button no longer does anything when long pressed) .

    anyway, please help me . i'm quite new on android 4 .

  • android developer
    android developer over 12 years
    but they are on the top side of the screen , while in the previous version it was near the fingers , since it's on the bottom . also , for applications that need to be on full screen , there is no way to access the menu via the menu button, since it can't co-exist in this situation . it's like they force you to use this ui , even though some developers (and users) prefer it on a different position .
  • android developer
    android developer over 12 years
    can you please show a reference that tells that it was deprecated? it's just that so many applications use this button . not all devices are as huge as tablets, so screen space is expensive.
  • user1076637
    user1076637 over 12 years
    From Android 4.0 Compatibility Definition (CDD): "Device implementation MUST present a Menu key to applications when targetSdkVersion < 10 and SHOULD NOT present a Menu key when the targetSdkVersion >= 10". Check also what this has to say about optionMenu in Android >= 3.0: developer.android.com/guide/topics/ui/menus.html
  • user1076637
    user1076637 over 12 years
    I speculate that the new ActionBar was designed for better auto placement on a wide range of devices (phones, tablets, TV's, etc). Look also for the split option of the ActionBar. It allows to place some of the control at the bottom, as you like.
  • android developer
    android developer over 12 years
    but it still takes useless space . :( i can't believe how un-customizeable they made the new UI . it's as if the bottom buttons exist on the screen for nothing - there is no API for using or customizing them . when they presented the on-screen buttons , i thought that we could add our own buttons there , but it's even worse - we need to add an extra bar even if we want to add option menu alone ...
  • android developer
    android developer over 12 years
    thank you . i hope they will change their mind some day , and give us a more flexible API for the bottom buttons . i thought that it's a very basic thing to have the menu button on android , since i saw it on every android device.
  • android developer
    android developer over 12 years
    also , i think that split option is only a way to suggest to android to use it when there is little space
  • IgorGanapolsky
    IgorGanapolsky over 11 years
    Yes, implementing the action bar is a pain in the arse. Especially when you have all of your apps using the old-style menu, and now you have to spend more development time creating this action bar. I guess Google doesn't care about wasting developers' time on their new features.
  • Ben Hutchison
    Ben Hutchison over 10 years
    The menu button is available in targetSdkVersion < 11 (tested on a Nexus 7 running KitKat).