3

how to check On-Screen or Physical/Capacitive Navigation Buttons on deviceenter image description here

Tobi Nary
  • 4,566
  • 4
  • 30
  • 50
Arpan24x7
  • 648
  • 5
  • 24

1 Answers1

1

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) {

}
Community
  • 1
  • 1
saur
  • 91
  • 9
  • HI @saur as above solution is working fine in Nexus , samsung devices but not working in Moto x play as welll Micro max device so is there any general solution ? – Arpan24x7 Feb 11 '16 at 09:49
  • @Arpan24x7 i have tested the code in moto e(1st gen)(L) and moto g(3rd gen)(M) for softkeyboard and redmi 1s(J) , redmi prime(K) as well as micromax a106(L) for hard keyboard and is working fine for me......is it specific to moto x play? which micromax device is it? – saur Feb 11 '16 at 11:09
  • Here i found bug in two device which i have, 1) Moto X play 2) Micromax Canvas Express 2 – Arpan24x7 Feb 11 '16 at 12:14