繁体   English   中英

Android物理/电容导航按钮

[英]Android Physical/Capacitive Navigation Buttons

如何检查设备上的屏幕或物理/电容导航按钮 在此输入图像描述

你可以使用ViewConfiguration.get(context).hasPermanentMenuKey()

仅适用于API级别14+

更多信息在这里这里

最好的答案就是这个

boolean hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey();
boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);

if(!hasMenuKey && !hasBackKey) {

}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM