如何检查设备上的屏幕或物理/电容导航按钮
发布于 2016-01-22 11:52:17
您可以使用ViewConfiguration.get(context).hasPermanentMenuKey()
ViewConfiguration.get(context).hasPermanentMenuKey()
仅适用于API级14+。
更多信息这里和这里
最好的答案是这
boolean hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey(); boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK); if(!hasMenuKey && !hasBackKey) { }
https://stackoverflow.com/questions/34942570
相似问题