Niels
Niels

Reputation: 1330

android overflow menu in bottom bar

I'm trying to get the overflow button from the action bar to show up in the bottom, next to the back/home/other-apps buttons. I was assuming this would be the case if I turn off the title bar, but it doesn't. I tried googling it, but I can't find any solutions.

Who can give me a hint?

For example this app has it: For example this app has it

Upvotes: 1

Views: 2919

Answers (3)

bradley4
bradley4

Reputation: 3938

Adding the overflow menu button to the system navigation bar is done to support apps targeting older version of android (2.3 and older) that don't have a hardware Menu button.

http://android-developers.blogspot.com/2012/01/say-goodbye-to-menu-button.html

The article above provides the logic when the system places the overflow button in the nav bar. It doesn't say how to force it to appear though for all devices. but it may help.

Upvotes: 1

Justin Morris
Justin Morris

Reputation: 7329

In your AndroidManifest you have to set the targetSdkVersion to 13 or earlier like this:

<uses-sdk android:targetSdkVersion="13" />

That will force ICS to run your app in compatibility mode and give you the 3 dots in your bottom bar for your overflow menu.

Upvotes: 7

Ali Imran
Ali Imran

Reputation: 9217

Did you try this code for creating option menu?

  //Menu options within the app.
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

Upvotes: 0

Related Questions