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.

Tags: BlackBerry Developers

Similar Questions

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

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

  • 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();
        }
    
  • 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.

  • 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

  • I can't get the screenshot of Windows to function at work. I try to push the Windows and print screen key, but it does nothing.

    When I used Windows 8 Developer Preview screenshot function worked fine. The screen flashed and saved my screenshots. I pushed the Windows and print screen key. Now that I've updated, I can no longer do this. I am of ideas what is wrong. Any help would be great!

    P.S. - This is the account I want to use! So I thought to it. In the case of my laptop (HP HDX 16 t) I have to press FN + WINDOWS KEY + print SCREEN. If anyone has the same problem, they should try it.

  • Conditional call forwarding and popup screen.

    Hi all

    I push a pop-up screen to cover a call out with my own information. However on my device and several others, a pesky "conditional call forwarding" popup is displayed by the phone which briefly takes precedence over my popup screen. Is this anyway to prevent this.

    I push the screen by using the following code.

    UiApplication.getUiApplication().pushGlobalScreen(activeOutDialScreen, 0,UiEngine.GLOBAL_SHOW_LOWER) ;
    

    I tried setting the summary field on a few different things, but nothing can stop the pop-up conditional reference poster.

    Any help or just confirming, that it is not possible would be greatly appreciated.

    Kind regards

    Alan

    None

  • Mobile profiles (phone and Tablet) screen does not display does not correctly

    RoboHelp 11 on a Windows 7 machine

    I have a small project that I asked in August and just pick it up again today. The only changes that I made today have a background color in the selected schema and adding browsers to the Profiles screen (mobile phone, desktop),. I also changed the pixel size of screen above and saved profiles, but eventually changed his mind and changed their return. I don't know if it would make any difference to this problem. (When I did size changes HR told me to update media queries, but I do not use all... or at least none came in functionality to handle media queries.)

    Then I re-generated output, but the Tablet and phone screen sizes are does not display correctly when I tested it by changing the size of my browser - there is a browser size quite large "dead zone" where no content is displayed at all (which almost makes appear as the 'sensible' part of the output does not work), inland navigation (front and rear bar and buttons) is pushed upwards in the header bar , and no horizontal browser scroll bar appears so that I can scroll to see the edge of the large images. I mainly use IE but it happened as well as Firefox and Chrome. The desktop display seems to work very well. (I'm sorry I have no screenshots now - I can provide some if necessary.)

    I was wondering if it had something to do with my chosen 'model' but a new project that uses that even a (Theme1_Standard) had no problem. Now, I also noticed that the model seems to have changed since I was last in Robohelp, because the overview of model unchanged today was not the same as the model from August. The Readme file for the latest patch does not mention everything that I thought that seemed to be related.

    As I said, I changed were all one color, browsers display profile and the profile screen sizes which I subsequently put discarded. I'm completely at a loss as to what caused this and how to fix it. I feel like an OAF comprehensive because it seems to be related to something I * DID * but back on my steps gave nothing.

    Thank you!

    UPDATE

    Still having this problem, but in poking around I discovered that some of the program files on my local machine have been updated in mid-September (when it looks like ReadMe file in the last patch was installed on my computer) and others have been updated mid-October (the first time I was in HR since mid-August, so anything is a not then generate). I don't know if this means anything, but to me it seems slightly suspicious. THX.

    I tried to reproduce the problem, but I can't get the the problem you describe. I do not have a dead zone and wide content scroll correctly.

    The screenshots are pointing to the former route Theme1, so there may be a problem here. Can you please try the following:

    • Delete the layout of your project.
    • In Windows Explorer, navigate to the folder! ScreenLayout! in your RoboHelp project and delete the Theme1 folder.
    • Claire the! SSL! folder.
    • Clear the DPC.
    • Remove the output that you previously generated to ensure that no old file remains.
    • Open RoboHelp, add the layout and generate without making any changes? It's working now?

    Just to be on the safe side, Adobe has released a fix for HR 11.0.3 that some sensitive issues in layouts, however not correct the issues identified in this thread: questions in RoboHelp 11.0.3

    Kind regards

    Willam

  • Driver IGFX stopped responding and the screen is now healed

    Hello!

    I have a problem with games on my Inspiron 1525. I found subjects with this problem but can't find any idea how to solve this problem.

    "Driver Igfx stopped responding and the screen has now recovered" - this error pops up when I play 3D games.

    Video: Mobile Intel® 965 Express Chipset Family.

    Latest drivers from dell.com are installed: 7.14.10.1409.

    Of the intel.com, I downloaded driver v7.14.10.1472 but cannot install it.

    How can I solve this problem?

    p.s. DirectX 10 installed.


  • remove the ads and pop-up windows

    What should I do if ads and pop ups don't stop posting on my safari and google chrome, I have the latest update of os x el capitan, most of them come on an empty space of OS im page he says by TurboMac and sometimes it redirect me to another page like mackeeper

    Click here and follow the instructions, or if you do not delete rather manually the adware, launches MalwareBytes for Mac.

    MalwareBytes simplifies the process of removal of adware, but does not stop it or other malware from entering the computer. It should not be invoked to prevent future incidents; Instead, avoid downloading software from sources other than the Mac App Store or Developer Web sites.

    (144253)

  • 'Lights' do not show in windows pop up and pop unders on Firefox for Mac 38

    Since I installed Firefox for Mac 38, 'lights' do not show in windows pop up and pop unders.
    Today, I installed Firefox 38.0.1 and the problem persists.

    I found the culprit: that's the theme Simple white (version 2.2b16).
    I removed it and now everything seems to work perfectly.

  • IPhone 6 continues to go to the turning off of the screen and the screen where I enter my access code.

    IPhone 6 continues to go to the turning off of the screen and the screen where I enter my access code to return. I hit Cancel on the stop screen or type my password the password screen and it goes back to the screen, I was on. I did a reset, all settings, but not him erase all content and settings. I went all day without any problems and an ago he started to panic. I took the cover of a few days ago thinking it might be the cause of the problem by pressing the power button, that wasn't the problem. Can someone give me some advice on what could be the problem?

    I have not updated my phone to the new IOS

  • My cat jumped up on top of the keyboard and rotated screen, how to fix this?

    My cat jumped up on top of my keyboard and the screen rotates. I searched but I can't know that defeat so the screen is in the normal position again.

    Hi dscamp,

    I don't think it's a Firefox issue, but the keyboard shortcut is Ctrl + Alt + [key]. CTRL + Alt + up should put your monitor in the right direction.

    Hope this helps!

Maybe you are looking for