Search code examples
androidmenuandroid-2.3-gingerbread

Use Gingerbread styled menu in Android


UPDATE: Drawing my own menu now. Thanks everyone.

I've googled around on the topic, but pretty much all I found was around changing the target build number.

I was wondering if there is some other way to use the old fashioned menu as in Gingerbread on newer versions of Android.

Thanks very much.


Solution

  • I think that you could try putting the default theme in. This changes the button styles too, so that can be a negative effect. I am also not sure whether it will change the menu styles, but it is definetly worth a shot.

    Add the following into your XML

    <application android:theme="@android:style/Theme">

    This should remove the holo theme, if it doesn't you can play around with some other themes until you find one which works. This might help - http://developer.android.com/guide/topics/ui/themes.html

    If that doesn't work your could try overriding the menu button to pull up a custom menu. Here is some code to override the menu button -

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if ( keyCode == KeyEvent.KEYCODE_MENU ) {
            //put code to call up your custom menu here
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }