机器人:以编程方式检测,如果设备有硬件菜单按钮 [英] Android: Programmatically detect if device has hardware menu button
问题描述
目前,我正在努力奋斗着这个问题。我需要检查设备,在安装应用程序的地方,有一个硬件菜单键。因为它不存在于像Galaxy Nexus的一些设备,我直接在这种情况下,用户界面示出它
我已经看了PackageManager.hasSystemFeature(),但没有发现任何有有用的。
有没有人已经做到了这一点?
ViewConfiguration.get(上下文).hasPermanentMenuKey()
请参阅<一href="http://developer.android.com/reference/android/view/ViewConfiguration.html#hasPermanentMenuKey()"><$c$c>ViewConfiguration#hasPermanentMenuKey()$c$c>了解更多信息。请注意,这仅适用于API级别14+(的Android 4.0冰淇淋三明治或更高版本)。
I'm currently struggling with this issue. I need to check if the device, where the app is installed, has a hardware menu key. Because it is not existing on some devices like Galaxy Nexus, I'm showing it directly in the UI in this case.
I have already looked at PackageManager.hasSystemFeature(), but didn't find anything useful there.
Has anyone already done this?
ViewConfiguration.get(context).hasPermanentMenuKey()
See ViewConfiguration#hasPermanentMenuKey()
for more information. Note that this is only available for API level 14+ (Android 4.0 Ice Cream Sandwich or newer).
这篇关于机器人:以编程方式检测,如果设备有硬件菜单按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!