06-07-2010 07:53 AM - edited 06-07-2010 07:55 AM
Hi,
I am trying to override the default function of Keypad.ESCAPE, and i use the following code:
protected boolean keyCharUnhandled(char c, int status, int time) {
switch (c) {
case Keypad.KEY_ESCAPE:
System.out.println("Escape button pressed");
// do something here, and then exit.
System.exit(0);
return true;
default:
return false;
}
}This method is in a class that extends MainSreen. I had to overide keyCharUnhandled because there is a edit field in the main screen, and if I override keyChar in the class, then the keyChar on the editfield won't be called (or at least thats what i thought what happened)
The problem is, when I use this approach (overriden keyCharUnhandled) it seems it cannot detect the BlackBerry menu button. How do I fix this?
Solved! Go to Solution.
06-07-2010 07:58 AM
you can override keychar safely if you call super instead of returning false
06-07-2010 08:02 AM
You know what, as soon as I hit the "Post" button, the same thought occured in my mind. ![]()
My bad, thanks for your reply. ![]()