开发者

Dealing with Android devices without MENU key

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 unofficia开发者_运维百科l Android devices like the Eken and aPad don't have a physical menu key.


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.


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


Check if device has menu key:

ViewConfiguration.get(context).hasPermanentMenuKey();

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜