0

I'd tested my app on a Nexus 10 (Android 4.2.1), and the overflow menu on the action bar worked fine. So I was dumbfounded when the overflow menu didn't appear on a Galaxy note 2. After reading Android action bar not showing overflow and How To Control use of OverFlow Menu in ICS, I eventually realised that on the Galaxy note 2 there's a built in menu button, and the "overflow menu" comes up if one presses that button.

The responses to those two questions suggest that one should not use the code there to disable to permanent menu button, because although it has the effect of (a) making the overflow menu appear in the action bar, apparently it also (b) forces the same behavior in other apps too. However, for me the overflow menu in the action bar is far superior to the menu button, and comments left on those two questions suggest that some other people think so too.

My question is, what is it possible to use that code to disable the permanent menu button in onResume(), and re-enable it in onPause()? How reliable a method would that be to make the action bar overflow menu work in my chosen app, with all other apps left unchanged?

Just for the record, it seems to me that the Android designers (both software and hardware) have somehow conspired to create this problem, and there's no easy solution. Some programmers think that having all apps work in the same way on a single device is more important than having any particular app work the same way across different devices. Other programmers think the opposite.

Community
  • 1
  • 1
Stochastically
  • 7,616
  • 5
  • 30
  • 58
  • 3
    There are well in excess of **300 million** Android users of devices with MENU buttons, who have been pressing the MENU button to get at the options menu (or the overflow for apps using something like ActionBarSherlock). In some cases, they have been doing this for years, without tons of problems. "Some programmers think that having all apps work in the same way on a single device is more important than having any particular app work the same way across different devices" -- more importantly, **users** think this. They do not care what your app looks like on devices that they do not use. – CommonsWare Apr 17 '13 at 23:47
  • 1
    @CommonsWare but what about users with multiple devices - one with and one without a hardware menu button? What about screenshots causing confusion? - "Why don't I see the 3-dots icon?". What about new users to Android who don't automatically think to go to the hardware menu button? One common complaint of Android is it's confusing to new users. Regarding the hardware menu button, I agree. Consistency can also be achieved by always showing the overflow icon (though this must be driven by the SDK to succeed). Personally, I'd like to see a checkbox in the system settings to control this. – Mark Jun 13 '13 at 02:51

1 Answers1

1

As others have stated, you really shouldn't be doing this. Let the menu work however it does in every other app (which depends on the device of course).

Also, there's no way you can affect the behavior of the menu button in other apps so you wouldn't have to worry about the whole onPause/onResume business.

LuxuryMode
  • 33,401
  • 34
  • 117
  • 188
  • Very interesting @LuxuryMode, the strength of the opinions on those two old questions made me think that other apps were affected. But now I've re-read, I guess I was mistaken!. So I guess it just comes down to whether consistency of one app across devices trumps consistency of many apps on one device or not :-). – Stochastically Apr 17 '13 at 23:46
  • @Stochastically yeah believe me, I can empathize. I know that sometimes design considerations make you feel strongly about overriding default behavior, but it's usually not worth the hacks. 99% of the time, you're better off just going with the defaults unless you have a really, really good reason -- and even then you're fighting an uphill battle in terms of introducing unstable hacks, etc. – LuxuryMode Apr 18 '13 at 00:08