Using onKeyDown
with KEYCODE_MENU
do nothing but it work with KEYCODE_SEARCH
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch(keyCode){
case KeyEvent.KEYCODE_MENU:
Toast.makeText(this, "Menu key pressed", Toast.LENGTH_SHORT).show();
return false;
case KeyEvent.KEYCODE_SEARCH:
Toast.makeText(this, "Search key pressed", Toast.LENGTH_SHORT).show();
return false;
}
return super.onKeyDown(keyCode, event);
}
I think there is something handling the menu key so it won't listen to my code
i have tried disbling onCreateOptionsMenu
like this:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
return true;
}
But still won't work..
So, any ideas to make the menu button listen to onKeyDown
??