Search code examples
androidmenuandroid-4.0-ice-cream-sandwich

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.


Solution

  • 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