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.

Tags: BlackBerry Developers

Similar Questions

  • 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.

  • 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.

  • 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.

  • 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.

  • Try to install and run Acrobat 9 Pro on Mac Air of 2010 running El Capitan. I get a pop screen saying that acrobat has detected there are missing components to a safari plug.

    Screenshot 2015-11-10 08.22.20.png

    Hello

    Acrobat 9 is quite an old version of Acrobat.

    It is also not a version compatible with Mac OS El captain.

    This could be the reason why you are getting this pop-up.

    Concerning

    Sukrit diallo

  • Why Crackle keep popping up on my TV screen while I watch other programs?

    I went to Crackle the other day to see what they offered. I have not found anything so I went. Now, while I watch TV crackling POP screens just up and interrupt my viewing. Can someone help me solve this problem?

    Finally had to reset my TV to the factory settings. After that he went.

  • Agent desktop screen pop

    I was asked to set up the phone system to do a pop from the screen when a call comes through CSQ. I got to work as expected (send customer information collected through data of the company with a web application and displays the agent via Internet Explorer). Which came now that I put in full implementation, we get the next pop screen for each call to the agent (internal and external calls). Is it possible to prevent a next pop screen during a call (agent to agent) internally but who have still a pop screen happen when a call comes in from the outside through CSQ? Thank you.

    Unfortunately not. The best idea here is to have a personal line for agents sepereate they receive some non-IPCC incoming calls. Confgigure therefore the IPCC line only receives calls routed IPCC.

    Please evaluate the useful messages.

  • APP crashes when closing a screen, loses focus and said having no screens

    I'm learning the basics for development of Java for BlackBerry, the version I use is 6 SDK.

    While working on an example provided in my workplace, I came across a bug that causes the app freeze and stop to respond to user input after the closure of a screen. The console output showed a message saying:

    Application in the foreground * lost focus because it has no screens.

    which is weird, because a screen again. After that without this intervention can be made with the soft, I'm only able to hold the button menu to select go to the home screen, but if I try to enter the app is still frozen in the last window, I even rebooted the device and the app has remained the same (I do not know if this kind of persistent behavior is normal in the development of BlackBerry).

    Just uninstall and then reinstall the soft manages to "solve this problem."

    I checked the sample project and there is a class called ScreenManager which is implemented to manage the screens shown on the app. He keeps a vector of the stack of the current screens are displayed. This class is mainly used to manage paths inside the application, for example if I executed the action j Screen C, rather than return to Screen B, show screen F.

    Each class that extends the screen has its onClose overloaded method:

    public boolean onClose() {}
    ui.getSm () .back (null);
    Returns true;
    }

    to call a function named return on this class of ScreenManager, which checks the current state of the stack of the screens, if the vector object has only one object, then a dialog box asks the user what to do, if you close the application or stay in the app. Where there is more than 1 screen in our vector object, then simply call the method that executes the anti-pop call:

    {} public void back()
    If (pageStack.Size () - 1 == 0) {}
    a single screen in stack, see the dialog box asking if the user wants to close app
    choose int = Dialog.ask (Dialog.D_YES_NO,
    ui.getRb () .getString (IU. EXIT_YES_NO));
    if(Choose==Dialog.Yes)
    {

    System.Exit (0);
    }
    } else {}

    Method that handles the anti-pop call and removes the current screen of our vector object
    popPageStack();
    }
            
    }

    The popPageStack method looks like this:

    private void popPageStack() {}
    pageStack.removeElementAt (pageStack.size () - 1); remove the object that represents the current screen
    UiApplication.getUiApplication () .popScreen (UiApplication.getUiApplication () .getActiveScreen ()); remove the current screen of the application
    }

    Because this entire logic is called when fires the onClose method, I do not understand how I can "run out" of screens, especially since the console is saying there are not and a screen is still displayed.

    What caused this problem in the application? Is it posible to pop the entire screen in the application and still be in the app?

    EDIT

    I did a little test of my own project and placed a menu item when you press on removes the only window I have and the behavior I described above is checked.

    For some reason any test project, I am student pop all of its screens when you press return, but I don't understand how is it still possible. What I am pressing too fast back button and it is somehow triggering several persistent organic pollutants?

    The situation you described happens when you last screen of pop on the BlackBerry 'view stack' but does not close the application.  Thus, the Blackberry operating system still tries to display something for the application and which is usually the last screen was displayed. However this isn't a real screen, so there is no interaction, like indeed the application has hung.  There no, there just no screens.

    Now, you are going to say that can't happen because you keep track of the screens in the stack.  But sorry, I would say that this is what is happening and there is a bug in the management of battery screen.

    In my opinion, it is a potential bug in the management of your stack.  I think you should recover the real of the Vector and pop screen than the screen, not that active.  You can also check to make sure that the screen that you are appearing is active.  Then allows you to detect when the battery of the screen that you have is not synchronized with the BlackBerry screen battery.

    I don't know why your application is now its own stack of anyway, given that the Blackberry has a display of the battery itself.  You can browse the BlackBerry screen battery using getActiveScreen(), then getScreenBelow().

  • ChangeListener to a new screen

    Hello

    I'm trying to get a button when you press to move to another screen.

    I have a button with a ChangeListner attached to it.

    Listener button1Listener = new Listener();
            button1.setChangeListener(button1Listener);
    

    The listener class is as follows:

    public class Listener implements FieldChangeListener{
        public void fieldChanged(Field field, int context){
            ButtonField button = (ButtonField)field;
            final String label = button.getLabel();
            UiApplication.getUiApplication().invokeLater(new Runnable(){
                public void run(){
                    Status.show(label + " was pressed");
                    page1 page1 = new page1();
                    page1.pushScreen(page1.screen);
                    page1.enterEventDispatcher();
                    }
                });
        }
        }
    

    Page 1 is the next page, I want to go, but when I press the button1 on the other screen I get a "error JVM 104 Eception: RuntimeException.

    All solutions? N ' not hesitate to change what I did!

    Thank you!

    With out being rude here, if you learn Java on BlackBerry, I suggest you use some other resources that are around, especially the sticky thread on this forum:

    Useful links for beginners and experienced programmers
    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&thread.ID=13264

    My personal favorites of this are:

    Getting started
    http://NA.BlackBerry.com/eng/developers/started/

    Labs
    http://NA.BlackBerry.com/eng/developers/resources/developer_labs.jsp#tab_tab_jde

    And I would say especially since see you the development Guide and the examples provided with the JDE - there is lots of really useful stuff you use no wait on someone to fix your code so that maybe you do not understand and therefore cannot maintain.

    In this case, you must understand that, to move from one screen to the next you push and pop screens - examine the samples to see this in practice.

  • Loading screen, do not appear

    I'm working on a code that was developed by my colleague. I think that there are some flaws in the design. I'm putting a loading screen when browsing the A SCREEN-> SCREEN B.

    The reason to use the loading is, data SCREEN B screen is obtained from network, communicating with the server, the analysis with the EVENT THREAD, in the listener fieldchange the field button I get this code.

    public void fieldChangeListener (field has, int context)

    {

    UiApplication.getUiApplication.pushScreen (loadingScreen);

    ---------------------------->>>POINT A

    UiApplication.getUiApplication.invokeAndWait (new Runnable()

    {

    Network connection, analysis SAX, etc.

    }

    );

    If (condition for next screen)

    {

    Condirion to the next screen

    SCREEN B or C of the SCREEN or SCREEN D

    }

    }

    //-------------------------------->>>POINT B

    The popup screen is missing or sandwiched between the two A and B, which occur once I got back from B.

    When the code between POINT A and POINT B is commented, loading screen occurs.

    Help of any kind is appreciated!

    A Y.

    Erez,

     

    Thanks for your response! It was a great help!

    ========================================================================================

     

    The problem is with the design patterns, the loading screen is appeared when I'm moving from Ecranun to screen B, but it is not visible as A SCREEN (which is still visible) always takes action the network at the end of who I am popping screen B! Thus, the anti-pop responsible without being noticed is covered by SCREEN B.

     

    There are two possible ways to get what I need,

    (a) put the network wire in another code

    (b) use a dialog box!

    The problem is with the model of design thinking, I want to mark this thread as it is closed!

    A Y.

  • How to make appear the current screen automatically?

    Hello

    We develop a game. What we try to do is

    at the end of the stadium successful,.

    We expect a progress screen level. and it displays as just 5 seconds.

    After this match, continue with the next level.

    When we pop screen in thread then

    level progression is displayed perfectly, but after 5 seconds, an exception occurs.

    and when we use as nothing of this poster.

    GameCompletionScreen gameCompletionScreen = new GameCompletionScreen();
    getUiEngine () .pushScreen (gameCompletionScreen);
                            
    _levelCompThread = new LevelCompThread();

    Screen scrn = getUiEngine () .getActiveScreen ();
    getUiEngine () .popScreen (CNRS);

    Thread sleeps for 5 seconds.

    Give me an idea about it.

    Thanks & best regards,

    Narendra shekhawat

    Hi guys,.

    I did it.

    Thank you.

  • Not pushing the screens and camera 8900

    Im having two problems in my code...

    the first don't push a screen in a menu. What of weird, is that I have two other options on the menu that will push the screens.

    Here is the code:

    private _server MenuItem = new MenuItem ("Server", 110,
    30 k
    {
    public void run()
    {
    UiApplication.getUiApplication () .pushScreen (new Server());
                    
    }
    };

    the second problem is very similar... but it's the camera of 8900 dreaded

    SerializableAttribute public class CameraScreen extends form {}
        
    private photMan PhotoManager = new PhotoManager();
        
    private VideoControl _vidcon;
    Player;
    _videofield of private sector;
        
    private String image_Type = "encoding = jpeg & width = 2048 & height = 1536 & quality = very good;
    private byte [] image_Array;

    Phto of photos;
     
    CameraScreen _camScreen;
        
    VerticalFieldManager _vfm = new VerticalFieldManager (VerticalFieldManager.USE_ALL_HEIGHT |) VerticalFieldManager.USE_ALL_WIDTH)
    {public void paint (Graphics graphics)
    {
    graphics.setBackgroundColor (0x00BDC29A); / / Gray special
    Graphics.Clear;
    Super.Paint (Graphics);
    }};
        
        
    Private UiApplication UiApp;
        
    CameraScreen (Photos pht) {}

    Games of skill to the singleton
    photMan = PhotoManager.getInstance ();

    UiApp = UiApplication.getUiApplication ();
    Photo gets assigned locally and assigns him photomanager
    This.PHTO = pht;
    photMan.setPhoto (phto);
    make easy pop screen
    _camScreen = this;
                
    Add the player to the screen to be used
    _vfm. Add (_videofield);
            
        
    This starts the camara media feature
            
            
    CreateCamera();
    try {}
    Player.Start ();
    } catch (MediaException e) {}
    Dialog.Alert ("Err:" + e);
    }
            
            
    Dialog.Alert ("Press Enter to take photo");
    }

    It takes the photo and shows a preview
        
    Public Sub takePicture()
    {
    Dialog.Alert ("what happens");
    try {}
    photMan.setImageData (_vidcon.getSnapshot (image_Type));
    Dialog.Alert ("inside the test');
    } catch (MediaException e) {};
                               
               
    Dialog.Alert ("just before the next screen push");
    UiApp.pushScreen (new CamPreviewScreen (_camScreen));
            
        
    }

    Public Sub CreateCamera()
    {
    try {}
    Reader = Manager.createPlayer ("capture://video");
    Player.Realize ();
                
    _vidcon = (VideoControl) player.getControl ("alarm");
                
    If (_vidcon! = null)
    {
    _videofield = _vidcon.initDisplayMode (Field) (VideoControl.USE_GUI_PRIMITIVE, 'net.rim.device.api.ui.Field');
    _vidcon.setDisplayFullScreen (true);
    _vidcon.setVisible (true);
    }
    Add (_videofield);
                
                
                
            
    } catch (Exception e) {}
                    
    Dialog.Alert("E:"+e);
    }
    }

    -------------------------------------------------------------

    I use a headset button to access the feature, and I know that the function is called... This works also in the Simulator, but not in the device...

    Any help would be appreciated...

    This is random... but I solved the problem of 8900. Also, it happened to me when I was with the InvokeCamera App. The solution to get the CameraDemo to work is to make sure you build the program is less than or equal to the JDE version JDE on the phone

    Example:

    Compile the JDE 4.6.0 (computer)

    Work on 4.6.1 (phone)

    Compile the JDE 5.0.0 (computer)

    Does not work on 4.6.1 (phone)

    Just make sure that you compile the .cod with the correct version of the SDK and you wil have no problem. Hope this can help some people.

    Note: You will still need to clear the screen of all fields except for the videoField to do, this includes the setTitle()...

  • Why do I get this exception - anti-pop: UiEngine is null! = net.rim.device.api.ui.UiEngineImpl@1ee2b551

    It happens when this code is run:

    public void popMyScreen(){  if (screen != null){    Application.getApplication().invokeLater( new Runnable(){        public void run() {           try{          UiEngine ui = Ui.getUiEngine();           ui.popScreen(screen);     }catch(Throwable e){      if (TasteMyCity.getDebug())TasteMyCity.writelog("******* TasteMyCity popMyScreen  ",e);       screen=null;  }    }});}}
    

    The method is called from a number of places in my code - but sine I put everything in the Ui thread, I thought it would work like this.

    PS: This error message, what is happening in my journal it's track of the stack also has this:

    GraphicsInternal.updateDisplayFromBackBuffer (int, int, int, int, int, int) line: 1132
    UiEngineImpl.removeScreenInternal (Screen) line: 2001

    Most, if not all of them actually run on the thread of events, so you work for yourself.  In addition, given that you have placed the code one invokeLater, you don't need to use the UiEngine looking for the current UiApplication approach - you can use UiApplication.getUiApplication ()...

    Can I ask you to change the code as follows, but put to debug the instructions in the "exceptions" I note so that we can understand what exceptions occur.  You can throw a RuntimeException to each point, if you wanted to, that would get us an at least Stack Trace.

    public void popMyScreen() {}
    If (display! = null) {}
    Application screenApp = screen.getApplication ();
    If (screenApp == null) {}
    Believe that this means that the screen has already been jumped
    return;
    }
    final UiApplication runningApp = UiApplication.getUiApplication ();
    If (runningApp! = screenApp) {}
    This application cannot jump the screen anyway!
    return;
    }
    If (!) () runningApp instanceof )) {}
    Works do not our application!
    Should we be popping screen of others?
    return;
    }
    If {(UiApplication.isEventDispatchThread ())}
    runningApp.popScreen (screen);
    screen = null;
    return;
    }
    runningApp.invokeLater (new Runnable() {}
    public void run() {}
    try {}
    runningApp.popScreen (screen);
    } catch (Throwable e) {}
    If (TasteMyCity.getDebug ()) TasteMyCity.writelog("*** TasteMyCity popMyScreen",e);
    screen = null;
    }
    }
    });
    }
    }

  • How the principal to another screen?

    Hi, I have a UiApplication in which I need to implement a few MainScreens. in fact, there is a screen (the one that is in the pushScreen()) start and few managers that behaves like the screen. I crushed onMenu method and add a few items. How can I do, when I click on the appropriate item Manager1 is set to visible and main screen?

    Kind regards

    1. you can only use one screen and three different feeder and switch between managers according to your menu.

    2. or you can use three different screen. In this case, all the three screen must be the same type of menu. Then pop screens and push the

    menus. Something like this:

    public class MainApplication  extends UiApplication {    public MainApplication()     {        super();               pushScreen(new A());    }        public static void main(String[] args)    {        MainApplication main = new MainApplication();       main.enterEventDispatcher();    }
    
        public class A extends MainScreen    {        public A()        {           this.add(new LabelField("A"));        }
    
            private MenuItem menuA = new MenuItem("switchA",100,10)        {            public void run()            {                //do nothing                 //you are already in screen A                                      }              };
    
            private MenuItem menuB = new MenuItem("switchB",150,10)        {            public void run()            {                popScreen();                UiApplication.getUiApplication().pushScreen(new B());            }              };
    
            private MenuItem menuC = new MenuItem("switchC",200,10)        {            public void run()            {                popScreen();                UiApplication.getUiApplication().pushScreen(new C());                      }              };
    
            protected void makeMenu(Menu menu, int instance)        {                    menu.add(menuA);            menu.add(menuB);            menu.add(menuC);                                // default menu            //super.makeMenu(menu, instance);        }    }  
    
        public class B extends MainScreen    {        public B()        {            this.add(new LabelField("B"));        }        //add menu like A    }
    
        public class C extends MainScreen    {        public C()        {            this.add(new LabelField("C"));        }        //add menu like A    }    }
    

    Concerning

    Bika

Maybe you are looking for