Reputation: 120324
I'm told by some users that my Android app is not usable because their device does not have a MENU key.
What's the best way to deal with these devices? Is it possible to detect if the device lack a MENU key and show a menu button only in this case?
And most importantly, how do you test this in the simulator?
Thanks.
Edit: Apparently the problem was that the users didn't know that the Menu key was called the Menu key.
Edit: Also, some unofficial Android devices like the Eken and aPad don't have a physical menu key.
Upvotes: 7
Views: 10733
Reputation: 1624
Check if device has menu key:
ViewConfiguration.get(context).hasPermanentMenuKey();
Upvotes: 2
Reputation: 2690
Starting with Android 3.0 (API level 11), devices are not required to have a dedicated Menu button. (Read more about this here: http://developer.android.com/guide/topics/ui/menus.html)
This means you should provide another way for your users to activate the menu. You can create a button and call openOptionsMenu(); when it is pressed.
Upvotes: 7
Reputation: 111555
I'm quite surprised that there are devices without a Menu key out there, as stated in my comment.
As this recent question mentions, there isn't really any API provision for detecting this:
Programatically detect presence of hardware call/hang up keys
It would also seem that there is no "menu key" hardware option that you can emulate using an AVD:
http://developer.android.com/guide/developing/tools/avd.html#hardwareopts
Upvotes: 2