0

I am trying to add items to the bottom action bar on android. I have placed the following into my manifest as required by what I've read on Google dev.

        android:uiOptions="splitActionBarWhenNarrow"

and I have a layout file as follows:

<item
    android:id="@+id/menu_settings"
    android:orderInCategory="100"
    android:showAsAction="ifRoom"
    android:title="@string/menu_settings"
    android:visible="true"/>

<item
    android:id="@+id/activityhomemen"
    android:orderInCategory="100"
    android:showAsAction="always"
    android:title="@string/activityhomemen"
    android:visible="true"/>

<item
    android:id="@+id/activity1men"
    android:orderInCategory="100"
    android:showAsAction="always"
    android:title="@string/activity1men"
    android:visible="true"/>
<item
    android:id="@+id/activity2men"
    android:orderInCategory="100"
    android:showAsAction="always"
    android:title="@string/activity2men"
    android:visible="true"/>

<item
    android:id="@+id/activity3men"
    android:orderInCategory="100"
    android:showAsAction="always"
    android:title="@string/activity3men"
    android:visible="true"/>

<item
    android:id="@+id/activity4men"
    android:orderInCategory="100"
    android:showAsAction="always"
    android:title="@string/activity4men"
    android:visible="true"/>

<item
    android:id="@+id/activity5men"
    android:orderInCategory="100"
    android:showAsAction="always"
    android:title="@string/activity5men"
    android:visible="true"/>

<item
    android:id="@+id/activity9men"
    android:orderInCategory="100"
    android:showAsAction="ifRoom"
    android:title="@string/activity5men"
    android:visible="true"/>

<item
    android:id="@+id/activity6men"
    android:orderInCategory="100"
    android:showAsAction="ifRoom"
    android:title="@string/activity5men"
    android:visible="true"/>

<item
    android:id="@+id/activity7men"
    android:orderInCategory="100"
    android:showAsAction="ifRoom"
    android:title="@string/activity5men"
    android:visible="true"/>

<item
    android:id="@+id/activity8men"
    android:orderInCategory="100"
    android:showAsAction="ifRoom"
    android:title="@string/activity5men"
    android:visible="true"/>

<item
    android:id="@+id/activity9men"
    android:orderInCategory="100"
    android:showAsAction="ifRoom"
    android:title="@string/activity5men"
    android:visible="true"/>

When I run the application on the emulator I can see the first 5 items of the menu. When I click on the overflow button I see the remaining items. Should they not be appearing on the bottom bar because of what I inserted into the manifest?...

Any help is much appreciated.

Below is screen of emulator. As you can see, overflow contains items and no bar showing at bottom...

enter image description here

Javacadabra
  • 5,578
  • 15
  • 84
  • 152
  • Only in a narrow scenario (e.g., phone or phone-sized emulator, in portrait). You might consider posting screenshots of what you are seeing. – CommonsWare Dec 13 '12 at 22:11
  • Are you using actioBarSherlock? – Artem Zelinskiy Dec 13 '12 at 22:18
  • I am using an emulator to replicate the nexus 7. It definitely wouldn't fall under the category of phone or phone sized, but i really need to display this bar at the bottom as the design will feature 4 buttons at the bottom on each screen. I read on Google dev that the action bar was the way to go. – Javacadabra Dec 13 '12 at 22:18
  • @Greensy no, I am using the standard ActionBar and my API level is 17 so up to date and above the minimum API14 – Javacadabra Dec 13 '12 at 22:19
  • Actually in two words, you should set target sdk to 14 if you want bottom, menu. Google deprecated it – Artem Zelinskiy Dec 13 '12 at 22:22
  • ok il go give that a try now – Javacadabra Dec 13 '12 at 22:25
  • I changed that but unfortunately no change! :( – Javacadabra Dec 13 '12 at 22:27
  • 1
    The split action bar will not be displayed on "non-narrow" devices like the Nexus 7. See: http://stackoverflow.com/questions/13606778/android-actionbar-will-not-split-on-device – Ryan R Jan 08 '13 at 19:37

1 Answers1

-1

If you want always show those items at the bottom. You can use tab widget in addition to you action bar. It will look like action bar on 4.0+.

http://developer.android.com/reference/android/widget/TabWidget.html

Update:

http://developer.android.com/reference/android/support/v13/app/FragmentTabHost.html - here is this class, that helps to add fragment navigation

Artem Zelinskiy
  • 2,201
  • 16
  • 19
  • I'll try that out, the only thing is it means a lot more work as I need to add this widget over and over and over again to each layout that requires it which is all of them, I don't understand why Google make some things like displaying a bottom bar so difficult!! – Javacadabra Dec 13 '12 at 22:37
  • You do not need to add it over and over. Just use Fragments api. and FragmentTabWidget class/ It really simple. Also i hightly recomend you to ise actionBarSherlock - it is a very good extention that helps a lot with action bars behavior. – Artem Zelinskiy Dec 13 '12 at 22:37