Clicking on the Blackberry trackball, instead of responding to an event, the context menu shows why?

I run the following script on some devices: when the use clicks on a field and waits for a response, instead of responding correctly to this click event, the device displays a context menu at the bottom of the screen.

navigationUnclick and trackwheelUnclick
From what I read, I can override navigationUnclick and trackwheelUnclick to prevent the menu from appearing. I do this as a screen level, but playing a centralized menu script is difficult. Is it correct?

Why is this happening? Is there any way to resolve this?

+3
source share
4 answers

I did it recently. I expanded MainScreento provide some basic functions, but did not want to use context menus. Returning truefrom n avigationClick()removes this behavior.

public class MyScreen extends MainScreen {
    protected boolean navigationClick(int status, int time) {
        /*  
        ... custom behavior ... 
        */
        return true;
        // the following line would trigger the context menu
        //return super.navigationClick(status, time);
    }
}

I did not have to redefine navigationUnclick()at all. Unlike the @JustinD override approach onMenu(), this only prevents the menu from this specific case - not across the screen (which you might need, and this would probably be the best way to do this).

In any case, it has been my experience with clicks and menus lately.

+6
source

Can you post your code? Try overriding trackwheelClick and navigationClick instead of Unlick methods. Also make sure that you return true in these methods.

+1

onMenu true ( ), ... - , , , , - true,

public class MyClass Extends MainScreen
{
   ///
  // Override onMenu to prevent menu from coming up when you click trackwheel 
  public boolean onMenu(int instance)
  {
    return true;
  }
}
+1

CONSUME_CLICK MainScreen...

0

Source: https://habr.com/ru/post/1715356/


All Articles