aambrozkiewicz aambrozkiewicz - 1 year ago 56
Android Question

Android actionbar icons always in overflow

I declared my menu items with

. My Activity is extending
. In preview it is as expected but when run on my phone is it always in overflow.

From what I've seen nothing else is needed. My phone runs in
Android 4.4.2 KitKat

Am I missing anything else?

Answer Source

You have to define your own namespace, if you want to use the showAsAction attribute with ActionBarCompat(I assume you are using ActionBarCompat because you mentioned, that you're extending ActionBarActivity):


and use showAsAction like this:

<item [...] app:showAsAction="always"></item>