nostradamus
nostradamus

Reputation: 53

Actionbarsherlock wont display menuitem in Android 4.x

I'm using actionbarsherlock as Actionbar. It works pretty good under android 1.x and 2.x but after some testing I noticed that the menuitems arent displaying in android 4.x. Here's the xml of my menu items

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

<item
    android:id="@+id/overview_newgame"
    android:showAsAction="withText"
    android:title="@string/new_game"/>

</menu>

And this is how it looks like under android 4.x

enter image description here

Upvotes: 0

Views: 186

Answers (2)

Try to use setTheme(R.style.Theme_Sherlock) before super.onCreate(savedInstanceState) in your onCreate

Upvotes: 1

Jake Wharton
Jake Wharton

Reputation: 76125

withText describes how the action item should be displayed but you have not specified where it should be displayed (hence it defaulting to never and going into the overflow menu).

If you would like it to show up on the action bar you should specify ifRoom.

See the setShowAsAction documentation.

Upvotes: 0

Related Questions