How can i distinguish “short menu” and “full menu” in code in blackberry?

StackOverflow https://stackoverflow.com/questions/1629012

  •  06-07-2019
  •  | 
  •  

Question

i am coding in blackberry jde.

but i am confused by the "short menu" and "full menu", for instance,how can i make a menuitem show only in "full menu" ? thx for ye help.

Was it helpful?

Solution

All the menu constructing code should be within the makeMenu function of the Screen. That's where you will populate your menu with the options your screen needs. The makeMenu function has a parameter called instance. This defines the kind of menu that needs to be made and you can key off of this for what should be added to specific menu types.

So, what you can do is add all your menu items for the short menu no matter what the instance is and then have the following if statement that would add all the menu items for the full menu:

if(instance == Menu.INSTANCE_DEFAULT) {
    // TODO Add menu items for full menu here.
}

Menu class JavaDocs

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top