Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Action bar overflow not displayed

I'm setting up an action bar with Sherlock with 3 items/icons. Running on a ICS emulator, I only can see 2 icons. And moreover: NO overflow menu (those 3 dots-icon)! I only get the 3rd icon if I press the menu button of the phone.

Do I have to force the overflow icon, and if so how can I do so?

like image 443
membersound Avatar asked Jun 05 '12 22:06

membersound


2 Answers

Do I have to force the overflow icon, and if so how can I do so?

All you need to do is have your theme inherit from one of the .ForceOverflow themes. Note this will only work for Android 2.0 and 3.0. In 4.0 the native ActionBar component is used instead, and the overflow item is only displayed if the device does not have a menu key.

like image 54
K-ballo Avatar answered Oct 01 '22 05:10

K-ballo


Do I have to force the overflow icon

No.

Your emulator is set up, by default, to emulate a device that has an off-screen MENU key, like the Nexus S. Such devices will not have an on-screen overflow menu button -- users will use the MENU key to access the overflow. Many of those devices, like the Nexus S, will be ones upgraded from Android 2.x, where the user will already be used to pressing the MENU key to get what used to be the options menu and now is the overflow menu.

You can switch your emulator to emulate a device without an off-screen MENU key. In your AVD Manager, for an AVD, add the "Hardware Back/Home keys" property (which, despite the name, also has the MENU key) and set it to be true or false as you wish.

like image 24
CommonsWare Avatar answered Oct 01 '22 04:10

CommonsWare