Overflow Menu Gone with 4.2

196 views
Skip to first unread message

Taraloca

unread,
Jan 11, 2013, 11:27:45 AM1/11/13
to actionba...@googlegroups.com
If a device has a hardware menu button, then the actionbar no longer has the overflow menu.  Is there a way to force this to always show in the actionbar?
Message has been deleted

Taraloca

unread,
Jan 11, 2013, 11:31:13 AM1/11/13
to actionba...@googlegroups.com
Forgot to show the code I am using:

@Override

public boolean onCreateOptionsMenu(Menu menu) {

mMenu = menu;

getSupportMenuInflater().inflate(R.menu.main_hourly_forecast_overflow_options, menu);

mMenu.setGroupVisible(R.id.graph_off_group, false);

mMenu.setGroupVisible(R.id.graph_on_group, false);

return super.onCreateOptionsMenu(menu);

}

Jake Wharton

unread,
Jan 11, 2013, 11:35:03 AM1/11/13
to actionba...@googlegroups.com

No. The hardware menu button is the overflow menu.

Taraloca

unread,
Jan 11, 2013, 11:48:32 AM1/11/13
to actionba...@googlegroups.com
The previous version of ABS showed the vertical overflow menu in the action bar.  What's the reasoning to not have in the latest version?  Just wondering so I can give a reason to my product managers with the application we're building using your library. :)

Jake Wharton

unread,
Jan 11, 2013, 11:58:26 AM1/11/13
to actionba...@googlegroups.com

If the hardware menu button is present ABS never showed the on-screen overflow. This is the native behavior of the OS, not ABS.

Taraloca

unread,
Jan 11, 2013, 12:05:07 PM1/11/13
to actionba...@googlegroups.com
I'm not sure what happened, but we just upgraded to 4.2 with the same code used as posted above, and the previous version showed the overflow and now doesn't.

SimonVT

unread,
Jan 11, 2013, 12:16:21 PM1/11/13
to actionba...@googlegroups.com
The ForceOverflow theme was available for <4.0 devices, 4.0+ there has never been a way to forcefully show the overflow button on devices with a menu button.

Taraloca

unread,
Jan 11, 2013, 12:17:16 PM1/11/13
to actionba...@googlegroups.com
It appears it was there and then you removed it :)  Here is from your change log:

Fix: Remove .ForceOverflow themes. These never should have been included.


SimonVT

unread,
Jan 11, 2013, 12:20:16 PM1/11/13
to actionba...@googlegroups.com
That theme did nothing on 4.0+ devices, which was the reason for it being removed.

Taraloca

unread,
Jan 11, 2013, 12:50:38 PM1/11/13
to actionba...@googlegroups.com
It actually did...I'm testing on a 4.0.4 Samsung Galaxy S II.  Prior to updating to your latest, I got an overflow actionbar.



SimonVT

unread,
Jan 11, 2013, 12:59:56 PM1/11/13
to actionba...@googlegroups.com
The attribute set by the theme was not read at all on ICS+. ABS does close to nothing but proxy calls to the framework on ICS+.

Taraloca

unread,
Jan 11, 2013, 1:34:15 PM1/11/13
to actionba...@googlegroups.com

Not trying to be difficult, but thought you'd like to know that the desired behavior is not what happened.  Attached are screenshots from build 27 (with previous version of ABS) and build 28 (with current ABS).

Build 27:

Build 28:


SimonVT

unread,
Jan 11, 2013, 1:46:59 PM1/11/13
to actionba...@googlegroups.com
The desired behavior is to not show the overflow item when there's a menu button. That's how the framework behaves.. But either way, ABS does not control how the action bar is displayed on ICS+. It just supplies the menu items.

Hugo Visser

unread,
Jan 13, 2013, 6:22:07 AM1/13/13
to actionba...@googlegroups.com
Well, that's the behavior of "real" 4.x devices, but you can still make the case for forcing the overflow or a options menu that is ICS styled on older devices. 

It's really a pain to supply the legacy menu icons and also kind of ugly. I rather not have to supply those, that would make a consistent experience on 2.x devices compared to 4.x and up. Forcing the overflow menu was one way to do that. 

I mucked around a few months ago to try to get the menu pop up like 4.x with a hardware menu key, but it didn't get anywhere really.

Hugo

Aru Sahni

unread,
Jan 13, 2013, 9:24:28 AM1/13/13
to actionba...@googlegroups.com
Wouldn't the most consistent behavior for those devices be that which matches other apps on the device? On 2.x, a user doesn't know the overflow menu - they're pretty familiar with the menu button, though.

Hugo Visser

unread,
Jan 14, 2013, 2:57:52 AM1/14/13
to actionba...@googlegroups.com
Yes, that's why I mentioned that forcing overflow was _a_ way to do that. My preferred option would be to style the overflow menu like it is in Android 4.x and up, but that isn't in abs either and I haven't managed to do it myself so far.

Bas Verhoog

unread,
Jan 14, 2013, 10:39:30 AM1/14/13
to actionba...@googlegroups.com
This has been explained countless times.

If a device featuring Android 4.0+ has a (hardware) menu button, the OS does not show the overflow button. This is standard Android behaviour.
Although ABS had the ForceOverflow theme at first, Jake realised that it was against stock Android behaviour, and would make a consistent UX across the platform harder to achieve. His goal is to keep ABS as close to AOSP as possible.

And that's why he removed it: because it doesn't fit Android's behavioural patterns.

Michael Basil

unread,
Jan 14, 2013, 11:05:51 AM1/14/13
to actionba...@googlegroups.com

Hugo Visser

unread,
Jan 14, 2013, 1:26:50 PM1/14/13
to actionba...@googlegroups.com

Awesome! Thanks for pointing that out.

Taraloca

unread,
Jan 17, 2013, 6:53:53 PM1/17/13
to actionba...@googlegroups.com

I appreciate ALL the response/comments/insight...much appreciated!  I agree with staying with the UI of the device, it was a product management request that with all your replies, they do agree with sticking with the phone's UI implementation.  Thanks for all your time.  :) Now to post another question with this new build...look for Share functionality if you can join the next conversation please.

Reply all
Reply to author
Forward
0 new messages