3

I've got two menu items, however one of them becomes inaccessible in portrait mode as there isn't room on the actionbar. I'm assuming it should get moved into an options menu accessible at the bottom of the activity and accessed by the hardware menu button on my gingerbread device, but this doesn't happen.

If I put my device into landscape both menu items become visible on the actionbar. Any ideas how I can fix this?

MainActivity.java

getSupportActionBar()
    .setDisplayShowCustomEnabled(true);
    getSupportActionBar().setCustomView(R.layout.actionbar_main);
    getSupportActionBar().setIcon(R.drawable.title);
    getSupportActionBar().setDisplayShowTitleEnabled(false);

menu.xml

     <item android:id="@+id/photos"

        android:title="Collections"
        android:icon="@drawable/content_picture"
                android:showAsAction="ifRoom"

        /> 

  <item android:id="@+id/contact"
        android:title="Contact"
        android:icon="@drawable/content_email"
                android:showAsAction="ifRoom"

      />
KingFu
  • 1,358
  • 5
  • 22
  • 42

1 Answers1

2

The overflow menu is not shown in the devices with a hardware menu button. That is how standard devices running ICS+ behaves. ActionbarSherlock replicates this behavior.

You can refer to Force overflow menu in ActionBarSherlock and How to force use of overflow menu on devices with menu button for more details.

Community
  • 1
  • 1
jaibatrik
  • 6,770
  • 9
  • 33
  • 62
  • I mean the "overflow" menu options displayed at the bottom of the screen. I'll re-word my question thanks – KingFu Apr 22 '13 at 20:00
  • I don't want to force an overflow menu, I want any menu items which don't fit on the actionbar "pushed" into the hardware button options menu, which I'm convinced is how ActionBarSherlock is meant to deal with older devices – KingFu Apr 22 '13 at 20:03