@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
...
return false;
}
Once the above method is added to an activity, the back button stops working but the other two buttons on the navigation bar - home and overview - still work perfectly.
Could anyone shed some light on this?
CodePudding user response:
Because You're always returning false from it. It should actually be conditional & in other cases, you should call super.onKeyUp(keyCode, event);
Example:
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (condition == true){
//do something
return false;
}
return super.onKeyUp(keyCode,event);
}

