0

I had implemented menu in my app successfully. But I am facing one another problem, When I click on the button menu appears as context menu. I don't want that menu to be appear while I am clicking on button field.

in constructor

addMenuItem(_mnu_showresult);
addMenuItem(_mnu_quit);

/declared menu item/

private MenuItem _mnu_showresult = new MenuItem(new StringProvider(
        "Show Result"), 110, 1) {
    public void run() {      
        Dialog.alert("You had scored ");
    }
};
private MenuItem _mnu_quit = new MenuItem(new StringProvider("Quit"), 110, 2) {
    public void run() {

    }
};

How I can solve this?

BSKANIA
  • 1,317
  • 15
  • 27

1 Answers1

0

You didn't paste the initialization code of the ButtonField. You may need to add the style bit ButtonField.CONSUME_CLICK on that ButtonField (which triggers the context menu to appear).

Use something like the following to create that button:

ButtonField myButton = new ButtonField("My Button", ButtonField.CONSUME_CLICK);
Rupak
  • 3,674
  • 15
  • 23