push or pop screen

What is the difference between pushscreen and anti-pop?

I'm doing the movement of the screen using this piece of code to move to the next screen,

UiApplication.getUiApplication().invokeLater(new Runnable(){
     public void run() {
         UiApplication.getUiApplication().pushScreen(nextScreen);
     }
});

but I noticed previous screen is still open even though the next screen is pushed.

What should be the right way of swich screens?

The screens displayed in the user's BlackBerry interface Applications are stored in a battery, called battery screen. The top of the stack is known as "active form" - entry screen alone which can become user. The screens that are closer to the top of the page obscure the deeper down.

pushScreen puts a (previously hidden - otherwise it will throw an exception) screen on the top screen, which makes it active. Anti-pop removes the activeScreen (if no parameter is given - this feature is obsolete) or specified screen (if - redisplayed, will throw an exception in the case) screen battery. If the top of the screen (active) is busted, one below becomes the upper - accept input from the user and scratch.

That's all! Design your application the way you see fit, but with this image in mind.

Tags: BlackBerry Developers

Similar Questions

  • Push and Pop screen in Thread

    Hello

    I'm running demo browser field of 4.6, and I want to push a wait dialog box before the thread starts, and pop as soon as I get the first event of the thread. Something like:

    public Object eventOccurred(Event event) {
    
            if (waitSc != null) {
                try {
                    thread.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                UiApplication.getUiApplication().invokeLater(new Runnable() {
                    public void run() {
                        UiApplication.getUiApplication().popScreen(waitSc);
                        waitSc = null;
                        this.notifyAll();
                    }
                });
            }
    }
    

    But this gives me IllegalMonitorStateException. Does anyone know what I am doing wrong?

    Thanks in advane.

    Yes, you can. You should use invokelater, invokeandwait or synchronize on the eventlock.

  • Pushing and Popping screen does not

    HI, when I select my options and click on the button, I want to close the current screen and open another screen, but I get a NullPointerException error.

    // Add Selected Field Change
            HorizontalFieldManager hfm5 =  new HorizontalFieldManager(Field.FIELD_HCENTER | Field.FIELD_VCENTER);
            final String choices[] = {"General","On The Course","On The Tee","On The Green","In The Bunker"};
            final ObjectChoiceField objsel = new ObjectChoiceField("Select a Chapter",choices,0);
            hfm5.add(objsel);
            add(hfm5);
    
         // Add Button To Page
            HorizontalFieldManager hfm4 =  new HorizontalFieldManager(Field.FIELD_HCENTER | Field.FIELD_VCENTER);
            ButtonField mySubmitButton = new ButtonField("Tee Off",ButtonField.CONSUME_CLICK);
            hfm4.add(mySubmitButton);
            add(hfm4);
    
            mySubmitButton.setChangeListener(new FieldChangeListener(){
                public void fieldChanged(Field Field, int context){
                    final String selectedValue = choices[objsel.getSelectedIndex()];
                    if(selectedValue.equals("General"))
                    {
                    General general = new General();
                    UiApplication.getUiApplication().popScreen(Ui.getUiEngine().getActiveScreen());
                    UiApplication.getUiApplication().pushScreen(general);
                    }
    
                    else if(selectedValue.equals("On The Course"))
                    {
                    OnCourse oncourse = new OnCourse();
                    UiApplication.getUiApplication().popScreen(Ui.getUiEngine().getActiveScreen());
                    UiApplication.getUiApplication().pushScreen(oncourse);
                    }
    
                    else if(selectedValue.equals("On The Tee"))
                    {
                    OnTee ontee = new OnTee();
                    UiApplication.getUiApplication().popScreen(Ui.getUiEngine().getActiveScreen());
                    UiApplication.getUiApplication().pushScreen(ontee);
                    }
    
                    else if(selectedValue.equals("On The Green"))
                    {
                    OnGreen ongreen = new OnGreen();
                    UiApplication.getUiApplication().popScreen(Ui.getUiEngine().getActiveScreen());
                    UiApplication.getUiApplication().pushScreen(ongreen);
                    }
    
                    else if(selectedValue.equals("In The Bunker"))
                    {
                    InBunker inbunker = new InBunker();
                    UiApplication.getUiApplication().popScreen(Ui.getUiEngine().getActiveScreen());
                    UiApplication.getUiApplication().pushScreen(inbunker);
                    }
    
                    }});
    

    Hi everyone, has managed to solve my problem, on my general screen, I was a drawing on the screen, but had not chosen a still, so left blank the file name. When I deleted this it worked.
    See you soon,.
    Max.

  • How to open push a new screen and pop the existing one?

    Hello

    Let's say I'm on A screen and I press a button to load the screen B. What is the best way to load screen B and remove the screen has?

    In other words, there are many cases in which I have to open, or push, a new screen and I want to close or pop, the pre-existing one. I tried to do this in two ways, but I keep getting errors.

    Thank you!

    Hello

    have you tried with

    UiApplication.getUiApplication () .popScreen (activeScreen);

    UiApplication.getUiApplication () .pushScreen (nextscreen);

    Please use the option "search" in this forum. you will get a lot a lot of samples on this topic.

  • My battery is swollen and pushing on the screen

    So I'm an avid user of Apple; I rave about how Apple products are all my friends all the time, because most of the time they are (this includes my IMac, Mac Book, IPad, and IPod).

    But in recent weeks, my IPhone 5 c has deteriorated. The battery seems to be swollen and pushing on the screen, causing my phone does not work at all except on the charge.

    Without warranty, what can I do? And how I can justify getting another IPhone?

    Take it to an Apple Store

  • Can I use a type of web page display when pushing a new screen?

    Hi all

    Can I use a type of web page display when pushing a new screen (java application)?

    Check with BrowserField. You can find the browserfielddemo example in samples of JDE.

  • Why use push and pop where addChild and removeChild can do the same work?

    Why use push and pop where addChild and removeChild can do the same work?

    What is the advantage of the push and pop on addChild and removeChild?

    It depends on what you're trying to accomplish. If you explain more about under what circumstances you would use them, a more definitive answer can be provided.    Push and pop of the work for arrays.  addChild and removeChild work for displayObjects.

  • Push the pop-up screen at the top of the lock screen

    Hi, is it possible to grow a popup with some editfields screen, while the device is locked?

    I am currently using:

    Ui.getUiEngine().pushGlobalScreen(customPopUpScreen, 100, UiEngine.GLOBAL_QUEUE);
    UiApplication.getApplication().requestBackground();
    

    but it is not display the dialog box when the screen is locked. It seems possible, considering that the native app alarm shows the dialog box while the device is locked.

    Help please!

    I am sure that you are referring to http://supportforums.blackberry.com/t5/Java-Development/pushGlobalScreen-restrictions/m-p/19550/high...

    In this discussion, they came to the conclusion that nothing can get pushed on top of the screen to unlock except the native alarm alert dialog box. I guess I can push the alert dialog but I need user interaction while the device is locked, so I guess that answered my question

    Thanks Peter!

  • problem with screen push and pop

    Hello

    My problem is that when I click on the next button it will change from first page to the second page,

    even then again go to second page to page 3.

    now when I click on the "back" button, it will come on the second page of return and once again when I press on it will come on first page.

    but the problem is that now, if I click on the next button it go directly to the page fourth instead of second page.

    Please help me to solve it.

    Code:

    main class extends screen
    {
    ButtonField next1;
    ButtonField prev1;
    public int count;
     
    main public (con int)
    {
    County = con;
    setTitle ("PAGE" + count);
         
    HorizontalFieldManager hfm1 = new HorizontalFieldManager();
           
           
    next1 = new ButtonField ("Next", ButtonField.CONSUME_CLICK);
    next1.setChangeListener (new FieldChangeListener() {}
    {} public fieldChanged no (field, content int field)
    if(Field==next1)
    {
    Count = count + 1;
    System.out.println ("Add" + Count);
    UiApplication.getUiApplication () .pushScreen (new hand (count));
    }
    }
    });
    hfm1. Add (next1);

    prev1 = new ButtonField ("Back", ButtonField.CONSUME_CLICK);
    prev1.setChangeListener (new FieldChangeListener() {}
    {} public fieldChanged no (field, content int field)
    if(Field==prev1)
    {
    Count = count-1;
    UiApplication.getUiApplication () .popScreen ();
    }
    }
    });
    hfm1. Add (prev1);
    }

    }

    You don't have to change your number of variable...

    Replace

        if(field==next1) {
              count=count+1;
              System.out.println("add"+count);
              UiApplication.getUiApplication().pushScreen(new Main(count));
        }
    

    with

        if(field==next1) {
            UiApplication.getUiApplication().pushScreen(new Main(count + 1));
        }
    

    And replace

        if(field==prev1) {
            count=count-1;
            UiApplication.getUiApplication().popScreen();
        }
    

    with

        if(field==prev1) {
            UiApplication.getUiApplication().popScreen();
        }
    
  • Why now do pop screens on firefox just as some other browsers/sites IE. screens with the faces of the people etc.?

    Screens pop up in the background of the main screen. Has never done this before. Fact all day yesterday and now as I type this question not a pop-up.

    Will do and thanks for the quick response.

  • Videos YouTube are pushed off the screen to the right by an ad, how to fix?

    When I click on a link to a youtube video, the video appears for a few seconds in the correct location of the site, but then an ad square appears on the side left forcing the video screen to be pushed all the way to the right and off the screen. The video will be displayed on the right side of the column of the videos ' read popular. " Sometimes, a scroll bar appears at the bottom of the window, because the page is now much broader, which will allow me to scroll right to see the video, however, sometimes the scroll bar does not appear and I see only the left edge of the video.

    I reinstalled Adobe® Flash® Player, which did not help and I also have the latest version of Firefox. This began to happen quite recently... maybe a week, there is or not.

    The reset Firefox feature can solve a lot of problems in restaurant Firefox to its factory default condition while saving your vital information.
    Note: This will make you lose all the Extensions, open Web sites and preferences.

    To reset Firefox, perform the following steps:

    1. Go to Firefox > help > troubleshooting information.
    2. Click on the button 'Reset Firefox'.
    3. Firefox will close and reset. After Firefox is finished, it will display a window with the imported information. Click Finish.
    4. Firefox opens with all the default settings applied.

    Information can be found in the article Firefox Refresh - reset the settings and Add-ons .

    This solve your problems? Please report to us!

  • How to push a Global screen on top of all the screen?

    Hi guys,.

    I'm working on an application of cascade.

    In the application from Server looging page and I have displayed in WebView Cascade using qml.

    Once the user is connected, I need start a clock and after 15 min, I need to display a screen on the top of any screen. Once the user submit on this newly pushed screen, I need to return to the previous screen where the user was.

    Please give me an idea how to do it.

    Hello

    This link below helped me to solve my problem.

    http://supportforums.BlackBerry.com/T5/Cascades-development/push-a-QML-page-using-a-C-defined-Naviga...

  • Pop screen

    I have what I think is a very simple question - I have an application that uses the screen and I have a ButtonField I want to blow up the screen when it is pressed.  i.e. go to the home screen - the same way, by pressing on the Red call end t - it.  I have a listener to this button and have tried different diets anti-pop filter, but each have locked this app with a loss of concentration.  Thanks in advance!

    Curious to know what you have tried.

    You have two choices:

    (a) upgrade the application in the background, just do:

    UiApplication.getUiApplication () .requestBackground ();

    (b) close the application

    UiApplication.getUiApplication.popScreen (UiApplication.getUiApplication () .getActiveScreen ());

    System.Exit (0);

    An anti-pop of the last screen will cause System.exit, provided that you do not have something that calls on the way and not great substitute called...  I think onClose() or close() methods involved are, but I have replaced always close() and do the above, when I want the app to go.

  • How to push the second screen?

    Hello

    I am writing an application in which I'm trying to push a second display to a custom in the first menu item. The first screen is pushed successfully and the custom menu items are filled with a bluetoothserialportlistener. Once I click on a special menu item, I want to launch the second screen. I used a dialog.alert to verify that the the menuitem run() method works, but the second screen is not displayed.

    Any suggestions are greatly appreciated!

    The first screen is created by hand (String [] args)

    MatMain app = new MatMain();

    app.enterEventDispatcher ();

    private MatMain() {}

    pushScreen (new WelcomeScreen());

    }

    I tried to call the second screen as follows:

    synchronized (UiApplication.getEventLock ()) {

    getUiEngine () .pushScreen (new MatOnline (_info));

    }

    I also tried:

    UiApplication.getUiApplication () .pushScreen (new MatOnline (_info));

    Thanks again!

    Hello

    I think you're trying in a very complex way.

    Your architecture using complex and ignoring the bluetooth codes related, I can see your second screen with a minor modification.

    In your DeviceMenuItem class.

    replaced

    MatMain.getUiApplication () .pushScreen (new MatOnline (_info));

    with

    UiApplication.getUiApplication () .pushScreen (new MatOnline (_info));

    And in your class MatOnline:

    replaced

    HorizontalFieldManager _fieldManagerOnline;
    with

    HorizontalFieldManager _fieldManagerOnline = new HorizontalFieldManager();

    Concerning

    Bika

  • Push the second screen

    I have classes: CustomMain and Menu.

    In my CustomMain I have a listener for a button when I press this button that my class of menu appears. but the screen is blank...

    CustomMain:

    My CustomMain extends UiApplication as

    FieldChangeListener customListener = new FieldChangeListener() {
                public void fieldChanged(Field field, int context) {
               UiApplication.getUiApplication().pushScreen(new Menu());
    
               }
    

    Menu

    My menu classes exends as screen

           MainScreen mainScreen = new MainScreen();
    
            ButtonField test = new ButtonFieldja);
    
            mainScreen.add(test);
            UiApplication.getUiApplication().pushScreen(mainScreen)
    

    The menu of your class is:

    class Menu extends MainScreen();

    Do in the constructor:

    Super();

    ButtonField test = new ButtonField ("jan"); d.Add (test);

    No need to use pushScreen in the constructor of the class Menu

Maybe you are looking for