Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Trusted Contributor
WorkHorse
Posts: 100
Registered: ‎01-13-2012
My Device: Simulator - 9800

Pop-up Menu Instead of Full Menu

Is there a procedure or command to have the pop-up menu appear in an application when the user presses the BB Menu button instead of the full menu?

Please use plain text.
Retired
awong
Posts: 8
Registered: ‎09-21-2009
My Device: Bold 9900

Re: Pop-up Menu Instead of Full Menu

Hi,

 

You can override Screen.onMenu and display your own pop up menu:

 

Override onMenu:

    public boolean onMenu(int i)
    {
        return false;
    } 

 

Create a pop-up menu:

http://docs.blackberry.com/en/developers/deliverables/17971/Popup_menus_1133453_11.jsp

- Alan Wong
Please use plain text.
Trusted Contributor
WorkHorse
Posts: 100
Registered: ‎01-13-2012
My Device: Simulator - 9800

Re: Pop-up Menu Instead of Full Menu

Hey thank you very much, the code you posted above does work for me and stop the default menu from showing up, i've also got the pop up menu to work. Do you perhaps know of a method to get the pop up menu to also, well, "pop up" in that statement. Maybe something like:  

    public boolean onMenu(int i)
    {
        // show the pop-up menu 
        return false;        // don't display the bottom menu
    } 

 I want to exchange what the blackberry button does from bottom menu to pop up menu. 

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,609
Registered: ‎07-14-2008
My Device: Not Specified

Re: Pop-up Menu Instead of Full Menu

I think the trick here is what I call the context, but the documentation calls the instance.  This is in my experience, set to 0, if the full menu is required and something else (I think 1) when the 'popup' menu is required.  So you could just override onMenu, then call super.onMenu(1) to get the popup menu.  Give it a try and let us know what happens.  

Please use plain text.