Do not show menu when button is pressed

My application has a button, and when I click the button, a context menu appears. How can I avoid displaying the context menu?

protected void makeMenu(Menu menu, int context){ menu.add(_imageMenuItem); super.makeMenu(menu, context); } class ImageMenuItem extends MenuItem { ImageMenuItem() { super("Login Screen", 0, 0); } public boolean onMenu(int i) { return false; } public void run() { UiApplication app = (UiApplication) getApplication(); app.pushScreen(new LoginScreen()); } } 
+6
blackberry blackberry-jde blackberry-simulator
source share
1 answer

Have you added style to ButtonField through the constructor?

 ButtonField button = new ButtonField("text", Field.H_CENTRE|ButtonField.CONSUME_CLICK); 
+16
source share

All Articles