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

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -