I\'m currently trying to add a click listener to the menu hardware button. Currently I\'m just putting my onclick logic into the onCreatePanelMenu-method and return false. B
Catch the key event inside onKeyDown() and add your action there.
Sample:
@Override
public boolean onKeyDown(int keycode, KeyEvent e) {
switch(keycode) {
case KeyEvent.KEYCODE_MENU:
doSomething();
return true;
}
return super.onKeyDown(keycode, e);
}
Just replace doSomething()
with your functionality/methods.