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
New Contributor
Posts: 8
Registered: ‎08-17-2011
My Device: 8700
My Carrier: Engineer
Accepted Solution

Popup screen blocks menu key

Is there any ability to push this popup without blocking menu key?

Developer
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: Popup screen blocks menu key

No.

 

You can implement the onMenu/makeMenu methods of the popup or to override them to call the relevant function of another screen.

 

E.

New Contributor
Posts: 8
Registered: ‎08-17-2011
My Device: 8700
My Carrier: Engineer

Re: Popup screen blocks menu key

Thank You!

 

I implemented it and now it works... But menu displays only after 2 clicks. The first click closes popup and only second one displays menu (

Developer
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: Popup screen blocks menu key

Can you post your code?
New Contributor
Posts: 8
Registered: ‎08-17-2011
My Device: 8700
My Carrier: Engineer

Re: Popup screen blocks menu key

public class RegionToolTip extends PopupScreen {

....

 

    public void close(){
        shape.setSelected(false);
        for(int i=0; i<closeListeners.size(); i++){
            ((RegionPopupCloseListener)closeListeners.elementAt(i)).onPopupClose();
        }
        super.close();        
    }
    
    public boolean onMenu(int instance) {
        close();
        super.makeMenu(mapChart.getScreen().getMenu(0), 0);
        return true;
    }

}

Highlighted
Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Popup screen blocks menu key

Your onMenu does not display menu - it only populates it (onMenu vs. makeMenu).

 

It should be more like:

public boolean onMenu(final int instance) {

  final Screen prevScreen = getScreenBelow();

  close();

  UiApplication.getUiApplication().invokeLater(new Runnable() {

    public void run() {

      prevScreen.onMenu(instance);

    }

  });

  return true;

}

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!