With the game I’m developing, I have an in-game menu the pops up when the menu button is pressed. However, I recently found out that the newer versions of Android don’t have a Menu button, but instead an Action Bar.
To note, I’m not using an actual Android menu. All I’m doing is detecting that the Menu button was pressed, and then handling the event from within the game. Which means all I need is something that the user can press, and detect that it was pressed.
So my question is, how can I support both a menu button and the newer action bar? I would like my app to support API levels 7-current.
UPDATE
Okay, after reading that article, I’d like to rephrase my question. It said that it “adds the action overflow button beside the system navigation.” My manifest has android:minSdkVersion=”7″ android:targetSdkVersion=”13″ but no overflow button appears on my emulator. The emulator is API 14 with skin WSVGA
This post in the Android Developers blog has a good discussion of the design transition from the old Menu Button to use of the new Action Bar and Action Overflow list.
It also includes some specific suggestions as to how to deal with your code when transitioning from pre-level 11 to the new Action Bar. May be helpful to you but for your specific application you will need to decide if you want to display an action bar or not. If not then you may want to add a button to your game interface that duplicates the functionality of the menu button on devices that have one.