android - show navigation drawer on physical menu button -


i want show navigation drawer when user clicks on physical menu button, override menu button following :

 @override     public boolean onkeydown(int keycode, keyevent event) {         if ( keycode == keyevent.keycode_menu ) {                  // code here show navigation drawer              return true;         }         return super.onkeydown(keycode, event);     } 

but don't know should show navigation drawer inside method.

p.s (i know not thing , team leader insist it)

drawerlayout.opendrawer(gravity.left) looking for. btw don't think bad think do, since lot of people not familiar drawer yet.


Comments

Popular posts from this blog

python - matpltolib navigation toolbar edit curves and parameters line color automatically changes issue -

node.js - Nodejs javascript implementation of PBEWithMD5AndTripleDES/CBC/PKCS5Padding -