Acknowledged

keyEvent.getKey() == 4 short vrs long pressed

Hi! I have the following problem, you might know the reason/solution.

I have the following code line:  if (keyEvent.getKey() == 4) {onSelect_lauch();}

I found that, in the simulator, for several devices, when I press the "Start-Stop buttom" (Key 4), if I press it long (not just one click but a "long" click), it launches properly the function but if I press it short, I gives me the typical error "Symbol Not found Error". It is an App (not a widget).

Error: Symbol Not Found Error

Details: Failed invoking <symbol>

Stack:

Do you know why and how to solve it?

Thanks!

Parents
  • You also may want to check for both KEY_ENTER and KEY_START as they are actually different buttons on some devices (edge devices).  And instead of using onKey(). use onSelect() and for up/down, use onPreviousPage(), onNextPage(), which with also work for touch devices.  And onBack() instead of looking for KEY_ESC

Comment
  • You also may want to check for both KEY_ENTER and KEY_START as they are actually different buttons on some devices (edge devices).  And instead of using onKey(). use onSelect() and for up/down, use onPreviousPage(), onNextPage(), which with also work for touch devices.  And onBack() instead of looking for KEY_ESC

Children