Roshnal
Roshnal

Reputation: 1314

Menu button on newer android devices

I'm creating an Android app for version 2.3.3 and higher (using the same SDK version) and I have used a legacy menu button.

I also have used a custom ActionBar library that doesn't have the menu overflow (?) capability. So is there any way for me to display the menu on newer Android devices without the physical menu button? Preferably without having to change the ActionBar to use another library or without having to use Android's newer SDKs?

Thanks.

Upvotes: 3

Views: 6517

Answers (2)

Siddharth Lele
Siddharth Lele

Reputation: 27748

You might also check a couple of my answers from the past few days. Both the questions are for ActionBarSherlock

Answer 1

Answer 2

NOTE: As also mentioned in both these answers, and I would like to reiterate. This is merely putting an option across for devs who would still like to force the OverFlow menu.

Upvotes: 0

Marcin Orlowski
Marcin Orlowski

Reputation: 75645

and I have implemented a legacy menu button

What for? Android would handle this by itself if your application is legacy one, it will add on-screen menu button on Honeycomb and up, so you just do not need to bother.

See this article: Say goodbye to menu button

If your app runs on a device without a dedicated Menu button, the system decides whether to add the action overflow to the navigation bar based on which API levels you declare to support in the manifest element. The logic boils down to:

If you set either minSdkVersion or targetSdkVersion to 11 or higher, the system will not add the legacy overflow button.

Otherwise, the system will add the legacy overflow button when running on Android 3.0 or higher.

The only exception is that if you set minSdkVersion to 10 or lower, set targetSdkVersion to 11, 12, or 13, and you do not use ActionBar, the system will add the legacy overflow button when running your app on a handset with Android 4.0 or higher.

Soft menu key for legacy app would look like this:

enter image description here

Upvotes: 3

Related Questions