The time has come, but I found a more reliable way than relying on hasPermanentMenuKey () , which does not work for newer phones like HTC One , which have no menu keys, but you have home and back keys, so no need (or show) soft navigation bar. To work around this, try the following code, which also checks the return button:
boolean hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey(); boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK); if(!hasMenuKey && !hasBackKey) {
source share