7

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 .

AakashM
  • 62,551
  • 17
  • 151
  • 186
android developer
  • 114,585
  • 152
  • 739
  • 1,270

3 Answers3

8

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.

user1076637
  • 768
  • 5
  • 15
  • 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. – android developer Jan 18 '12 at 17:04
  • 1
    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: http://developer.android.com/guide/topics/ui/menus.html – user1076637 Jan 18 '12 at 20:18
  • 2
    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 Jan 19 '12 at 21:38
  • The menu button is available in targetSdkVersion < 11 (tested on a Nexus 7 running KitKat). – Ben Hutchison Jan 08 '14 at 08:52
3

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

Bruno Oliveira
  • 5,056
  • 18
  • 24
  • 3
    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 Jan 18 '12 at 17:01
  • 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. – user1076637 Jan 18 '12 at 20:23
  • 3
    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 Jan 19 '12 at 21:35
  • also , i think that split option is only a way to suggest to android to use it when there is little space – android developer Jan 19 '12 at 21:54
  • 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. – IgorGanapolsky Dec 03 '12 at 16:35
0

targetSdkVersion no longer influence the visibility of the legacy overflow menu button on newer devices and OS, it's dead and buried.