Friday, February 20, 2009

Code : to access the screen below Popup screen


I made a transparent Popup screen. But i wasn’t able to access the screen below that Popup screen,such that Popup screen remains on the top, but focus gets on the screen below. I have accomplished that task by using following method :

public final void pushGlobalScreen(Screen screen, int priority, boolean inputRequired)

but now it work fine.

i corrected as Ui.getUiEngine().pushGlobalScreen(translucent, 4, false);

3 comments:

  1. Hi Rakesh,

    Great blog.

    I have tried the above piece of code, and i get a nice popup screen whilst keeping focus on the screen behind.

    However, I am not able to close/remove the popup screen using the normal close() method.

    Do you have any advice on how to close the popup or pop it off the display stack?

    Thanks

    ReplyDelete
  2. Hello,

    Once your popup screen pushed into display stack and after wards if you want to close it then you can use in appropriate place in ur code :

    try{ getScreen().getUiEngine().popScreen(popup);
    }catch(Exception ee){}

    If you have some doubt regarding this then also find it by one of my post "http://blackberry-digger.blogspot.com/2009/04/code-create-your-own-virtualkeyboard.html"

    ReplyDelete
  3. At the time of creation of popup screen you can set style parameter to 'PopupScreen.DEFAULT_CLOSE'.
    Hence when you press back key popup screen will close automatically.

    OR

    You can close it like :
    if (popup.isFocus()) {
    try {
    popup.close();
    } catch(Exception e) {}
    }

    ReplyDelete

Place your comments here...