简体   繁体   中英

Android Physical/Capacitive Navigation Buttons

how to check On-Screen or Physical/Capacitive Navigation Buttons on device 在此输入图像描述

you can use ViewConfiguration.get(context).hasPermanentMenuKey()

only available for API level 14+

more info here and here

the best answer that helped will be this

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

if(!hasMenuKey && !hasBackKey) {

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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