Menu button not showing on actionbar

480 views
Skip to first unread message

Michael Vogt

unread,
Mar 26, 2012, 10:56:17 AM3/26/12
to actionba...@googlegroups.com
So I'm brand new to ABS/Android/Java....fair warning!

I was able to get ActionbarSherlock loaded and showing the base action bar in a test project. I now want to add a couple of menu buttons. 

I extend my Activity with SherlockActivity. The code I use to inflate the menu uses actionbarsherlock.view as the type for Menu and MenuInflator:
@Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getSupportMenuInflater();
        inflater.inflate(R.menu.actionbar_menu, menu);
        return super.onCreateOptionsMenu(menu);
    }

When I run the test project, the buttons do not show up in the Actionbar. But when I press the menu button, the two menu items pop up as text menu item at the bottom of my test app.

Do I need to be using Fragments for this (I'm still trying to wrap my brain around Fragments in general and don't have a clear understanding when to use them in ABS...).

thanks.


Michael Vogt

unread,
Mar 26, 2012, 11:11:45 AM3/26/12
to actionba...@googlegroups.com
Ok, looks like I forgot to specify  android:showAsAction="ifRoom"  in the menu XML....
Reply all
Reply to author
Forward
0 new messages