Issue
@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?
Solution
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);
}
Answered By - Mayur Gajra
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.