modal screen Push called by an event no thead

I know it's very basic, but I'm not able to understand why I'm getting this, I use a screen to start and in the start screen, I use a background thread to perform my surgery needed to communicate with the server, once the finished background thread its task is the listener in the splash screen creates an object to the next screen and sends it to the method below.

public void swapScreen(final TopNewsScreen _tn)
    {
        UiApplication.getUiApplication().invokeLater(new Runnable(){
            public void run()
            {
                UiApplication.getUiApplication().popScreen();
                UiApplication.getUiApplication().pushScreen(_tn);
            }
        });

    }

Help of any kind is welcome

A Y

maghue is not correct, invokelater is the good method to use in most cases.

the OP code seems fine. I would say to draw the exception, perhaps, there is another code that triggers the exception?
the exception text that you pasted mentions "modal screen", but your code does not use pushModal.

Maybe you have a Dialog.alert in your separate thread?

Tags: BlackBerry Developers

Similar Questions

  • Create a modal screen waiting in ActionScript

    Hello world

    First of all, this forum has provided me with some good tips on getting my first PlayBook set App World so a big thank you to everyone on BOARD and the community in general to help.

    My problem

    I developed my application using Flash Builder 4.5 2.5 and the BlackBerry PlayBook AIR API.

    My application performs a long running operation that, via a Click eventcalls a web service and requests some data.  Currently, the application does not provide the user with all the comments and I would like to change that!

    I'm relatively new to the Flash Builder and I was wondering what was the best way to run an operation like this and show a transparent "wait modal" perhaps with an indicator of the activity of the user, then that happens.

    I tried to implement this in several ways (using the forms tanks etc.) but the modal never displays when the onClick event is fired.  I also looked in the background processing, but has been warned against the use of this.

    Any advice would be greatly appreciated.  I am relatively new to this development environment, so my apologies if this is obvious!

    Thanks in advance.

    Nick

    A request to a server is non-blocking, you could allow the user to continue working until the end of employment of server which you will get the reminder.  In this case, you can use the ActivityIndicator to inform the user that he has been transformed (in a passive way).  If work takes a lot of time and there is a way to query the status of the task, then a passive ProgressBar would show overall progress.  Both of these can be placed in a corner of the screen so that the user can see, but can continue to work according to the needs.

    However, if the work is a blocking request in which you do not want the user to do anything until the job is done, then you want to be a modal about it (less desirable).  You can place an AlertDialog window upward with "Please wait...". "in it with no button and then close the dialog box when the work is completed.  You will need to keep a grip for the alert dialog box so that you can close with the callback event.  QNX AlertDialogs side Server and you can not change the appearance, you can build your own screen with a semi-transparent background and the ActivityIndicator or the ProgressBar inside a frame to show activity progress with modality.  Connect the modal display customized to the scene.  If you have an app bar, you may need to suspend if the user can not cross to another page in your application.

    If the work is really long, I would add a features 'Cancel' in which case it's just taking too long for them because of network problems.

    Hope that helps.

  • java.lang.RuntimeException called by the event no thread

    Hi all

    Please help me.

    I download my application Suiloidi OTA. When I have my application rum, it throws an error "untrapped Exception: java.lang.RuntimeException called by the event no thread", please let me know if anyone with no work around for this problem.

    I'm really in trouble.

    Ashutosh

    Thank you

    I got a d solution.

    Your steps were correct.

  • Close an application from a screen pushed to the top of another screen?

    I have 3 screens pushed above the other. Since the top of the screen, I have an option to close the application from there. Should I blow the screens
    under the top of the screen before leaving the application or the system will take care of this for me?

    I have it. Thank you.

  • Screen pushing problem in the incoming call disconnected event

    When a phone call disconnects I would push a screen containing some information about the appellant

    In the call disconnected event I'm doing this:

    UiApplication.getUiApplication () .requestForeground ();

    UiApplication.getUiApplication () .pushScreen (new CustomScreen());

    It works most of the time.

    But when I close this screen the phone keypad.

    And sometimes my screen does not get pushed and the keypad appears.

    I could be wrong, but I guess that my screen is pushed in the wrong context?

    Can someone point me in the right direction?

    See you soon

    I have a slightly different take on this problem.

    I think that you run this code:

    UiApplication.getUiApplication () .requestForeground ();

    UiApplication.getUiApplication () .pushScreen (new CustomScreen());

    at your disposal, and if you run in the context of phone, not your application.

    The treatment of changes to it it context moves to your application - the best way to proceed is to use a Global event.  Search for informaiton on world events so this is new to you.

  • Screen that disappears on the event PhoneListener

    Hello.

    I create an object with the PhoneListener interface, and on the method of callDisconnected , I want to display a screen.  I am able to get the screen appears immediately after the end of the call, but what happens is that the screen for a short period of time, then disappears.  Attempt to failover to the active application has no effect.  Is anyone able to identify what I am doing wrong?  I tried several solutions.  Here is a copy of the callDisconnected code.

    {} public void callDisconnected (int callId)
    TODO self-generating method stub
            
    Try
    {

    UiApplication.getUiApplication () .invokeLater (new Runnable() {}
    public void run()
    {
    Make changes to screen here.
    ServiceLogScreen _serviceLogScreen = new ServiceLogScreen();
    Invalidate() call on your display requires painting
    method to call.
    UiApplication.getUiApplication () .pushScreen (_serviceLogScreen);
    }
    });
                
    }
    catch (System.Exception e)
    {
    Dialog.Alert (e.getMessage ());
    }
            
    }

    I guess that this is because the phone application moves to the background when a call is disconnected. You push the screen in the display of the phone application stack, because UiApplication.getUiApplication () returns the reference to the phone application. If you want to push a screen in the stack to display your application of your receiver, you can either send a global event to your application (and your application will need to respond), or keep a WeakReference to your application and call pushScreen or invokeLater on this reference, provided that the underlying purpose of the UiApplication is not null.

  • I get a blue screen caused by XDVAnnn.sys event

    I play a game called fiesta online, two weeks ago, when I tried to log on to the game wouldn't load.

    I rebooted the system, and as soon as the process has started I got a blue screen event and was forced to close.

    When I restarted the computer (presario CQ60) a notification has been shown and I reported to microsoft by using the problems and solutions and told me that there is a solution, the exact message is "Malware alert: problem caused by XDVAnnn.sys could be malicious.

    The solution was to scan a complete service in the center of windows onecare. The analysis concluded that there is no virus or anything else except registry problems that have been set.

    My internet security program is no problem and I can not find this program or anything like that.

    I'm using vista Home premium

    Help please, its driving me crazy...

    keeney1,

    Thanks for posting on the Microsoft answers Forum.  I did research on this error and what I found.  The XDVAnnn.sys file is apparently related to X-Trap that uses Outspark (Fiesta manufacturers).  X - Trap is an anti-cheating tool used by this company of online game.  I saw on the Outspark support page they request a screenshot of any error of X-Trap.  You can contact their support for all possible solutions.

    One thing I saw was a suggestion to disable your anti-virus program while playing the game. * DO this at YOUR OWN RISK * disable your anti-virus program can open your computer up to possible infections on the internet.  As you have seen that he is also suspected of having possibly attached to it as well Trojans.

    Mike - Engineer Support Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • New screen push within TabbedPane QML

    TabbedPane {
        id: tabbedPane
        showTabsOnActionBar: true
        attachedObjects: ComponentDefinition {
            id: pageDefinition
            source: "newpage.qml"
        }
        Tab {
            title: qsTr("Tab1")
            Page {
                id: tab1
                actions: [
                    // define the actions for first tab here
                    ActionItem {
                        title: qsTr("New")
                        onTriggered: {
                            var page = pageDefinition.createObject();
                            navigationPane.push(page);
                        }
                    }
                ]
                Container {
                    // define tab content here
    
                }
            }
        }
        onCreationCompleted: {
            // this slot is called when declarative scene is created
            // write post creation initialization here
            console.log("TabbedPane - onCreationCompleted()")
    
            // enable layout to adapt to the device rotation
            // don't forget to enable screen rotation in bar-bescriptor.xml (Application->Orientation->Auto-orient)
            OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.All;
        }
    }
    

    How can I push another page QML a TabbedPane? Currently, nothing happens when I invoke the action item.

    Hello

    NavigationPane definition is missing.

    Something like this should work:

        Tab {
            title: qsTr("Tab1")
            NavigationPane {
              id: navigationPane1          onPopTransitionEnded: { page.destroy(); }
              Page {
                  id: tab1              ...
    

    ...

    var page = pageDefinition.createObject();
    navigationPane1.push(page);
    
  • How to close a popup screen pushed as a global screen

    I want to close a popup screen but my application is in background so

    UiApplication.getUiApplication () .popScreen (getScreen ());

    or

    UiApplication.getUiApplication () .getActiveScreen () m:System.NET.Sockets.Socket.close ();

    does not work is not something

    same Ui.getUiEngine () .getActiveScreen () m:System.NET.Sockets.Socket.close () does not work...

    in the popup screen, I have a custoListView (written own filed) there is an item when you click on an event

    listner function is called by there, I have to close popup screen... my class is like that

    SerializableAttribute public class SelectSms extends PopupScreen {}

    private vector _data;

    public boolean onClose() {}
    try {}
    Close();
    Returns true;
    } catch (Exception e) {}
    Returns false;
    }
    }

    public SelectSms() {}
    Super (new VerticalFieldManager(), Field.FIELD_VCENTER);
    _data = null;
    _data = MessageStore.getMessage ();
    last post [] message = Message [_data.size (new)];
    MSGC [] CustomListField = null;
    MSGC = new CustomListField [_data.size ()];
    for (int i = 0; i)<>
    message [i] = (Message) _data.elementAt (i);
    MSGC [i] = new CustomListField (message [i] .getMSG_BODY (), message [i] .getMSG_NO (), and [i] .getMSG_STUS ());
    last post mesg = message [i];
    MSGC [i] .setChangeListener (new FieldChangeListener() {}
    ' Public Sub fieldChanged (field field, int context) {}
    onClose();
    }
    });
    Add (MSGC [i]);
    }
    can someone help me how to close the popup screen.
            
    }
    }

    Place the UiApplication.popScreen () call in an executable object and pass this object to UiApplication.invokeLater ().

  • If (child on screen) AS3 {play child} (keyboard.event)

    Maby someone can help me with this? :

    I have this script:

    var answerA:Array = [];

    function answerF(answerS:String,x:int,y:int,space:int):void {}

    stiff var: int = answerS.length;

    Word of the var: int;

    If ((answerS.length % 2) == 0) {}

    Word = (((raides * 150) + ((raides-1) * space)) / 2-150);

    } else {}

    Word = (((raides-1) * 150) + ((raides-1) * space)) / 2) - 75;

    }

    var nextX:int = x - Word;

    var C: Class;

    var letter: MovieClip;

    for (var i: int = 0; i < answerS.length; i ++) {}

    C = Class (getDefinitionByName (answerS.charAt (i)));

    Letter = new C();

    addChild (letter);

    answerA.push (letter);

    letter.x = nextX;

    letter.y = y;

    nextX += letter.width + space;

    }

    }

    On the library, I have objects whose names A, B, C, D, E, f... to Z

    This script adds letters from the library. With this script all ok it works perfectly for me, but I want keyboard event for each letter to play but now I don't know how to do this.


    I have a script:


    stage.addEventListener (KeyboardEvent.KEY_DOWN, AKeyDown);

    function AKeyDown(event:KeyboardEvent):void {}

    If (event.keyCode == Keyboard.A) {}

    A.Play ();

    }

    }

    This script works then object instance name.

    And I want to do:

    stage.addEventListener (KeyboardEvent.KEY_DOWN, AKeyDown);

    function AKeyDown(event:KeyboardEvent):void {}

    If (event.keyCode == Keyboard.A) {}

    If child with class name an exist on screen}

    playing the object with the name of class A


    } else {}

    var erreur.r: Sound = new eror();

    errorR.play (0, 1);

    }

    }

    }

    What you need to do, is to give each child a name as you load them.  Then, you can target with their name property.

    var C: Class;

    var letter: MovieClip;

    for (var i: int = 0; i<>

    C = Class (getDefinitionByName (answerS.charAt (i)));

    Letter = new C();

    letter. Name = answerS.charAt (i);

    addChild (letter);

    answerA.push (letter);

    letter.x = nextX;

    letter.y = y;

    nextX += letter.width + space;

    }

    }

    stage.addEventListener (KeyboardEvent.KEY_DOWN, AKeyDown);

    function AKeyDown(event:KeyboardEvent):void {}

    trace ("key pressed:" + string.fromCharCode(0)) (event.charCode));
    var ltr:MovieClip = MovieClip (getChildByName (string.fromCharCode(0)) (event.charCode)));
    LTR. Play();

    }

    You will probably need to convert the string.fromCharCode(0)) (event.charCode) uppercase if you are naming them with capital letters.

  • Telephone call about the event log errors - they claim to be the Technical Support

    Original title: event error logs

    I get a phone call from a person claiming to be a b/c my computer Tech support has published many errors in the event log.  Is - is this legitimate?  He wants me to do stuff in the event log.

    Hello

    Yes, it's a SCAM!

    Avoid scams to phone for tech support
    http://www.Microsoft.com/security/online-privacy/avoid-phone-scams.aspx

    In the United States, you can contact the FBI, Attorney general, the police authorities and consumer
    Watch groups. Arm yourself with knowledge.

    The Internet Crime Complaint Center (IC3) is a partnership between the Federal Bureau of Investigation
    (FBI) and the National White Collar Crime Center (NW3C), funded in part by the Bureau of Justice Assistance
    (BJA).
    http://www.ic3.gov/complaint/default.aspx

    No, Microsoft wouldn't you not solicited. Or they would know if errors exist on your
    computer. So that's the fraud or scams to get your money or worse to steal your identity.

    Avoid scams that use the Microsoft name fraudulently - Microsoft is not unsolicited
    phone calls to help you fix your computer
    http://www.Microsoft.com/protect/fraud/phishing/msName.aspx

    Scams and hoaxes
    http://support.Microsoft.com/contactus/cu_sc_virsec_master?ws=support#tab3

    Microsoft Support Center consumer
    https://consumersecuritysupport.Microsoft.com/default.aspx?altbrand=true&SD=GN&ln=en-us&St=1&wfxredirect=1&gssnb=1

    Microsoft technical support
    http://support.Microsoft.com/contactus/?ws=support#TAB0

    Microsoft - contact technical support
    http://Windows.Microsoft.com/en-us/Windows/help/contact-support

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • Locks screen during calls

    When I make a call on my premium Z5, the screen locks black and I can't use the functions until the phone is hung up by the person on the other end of the call. I did a complete reset, but it did not help, no matter who else had this problem?

    If the screen blocks black, this has something to do with your sensor, which is active during calls, so wash it in a very significant way.

    Calling someone without the sensor, it happen again?

  • onFocus() not pulling between screen push/pop

       protected void onFocus(int args)
        {
            super.onFocus(args);
            invalidate();
            Dialog.inform("Screen refreshed test.");
        }
    

    In the screen of my parent, I have this code that is not triggered during the initial loading screen up, nor when subsequent reviews are dépilés. I push the battery screens based on the options menu, when finished, I jump the battery that "theoretically" should mean a the next screen which is now visible won focus which should cause the onFocus trigger, but it didn't.

    This code does nothing... So that being said, when the 'parent' or 'visible' screen gains focus, I have to simply redo all controls and refresh data, so what method is used to determine that the screen is now from the top of the stack and visible?

    onObscured() / onExposed() pair is probably the most fitting place to check such things. Can be replaced by onVisibilityChange (boolean).

    However, unless you have some very custom paint override, don't bother invalidate - when the screen is pushed first, it is painted in any case; When all the screens above it get jumped (so that it becomes the active screen) it is also repainted the (partially, if the split screen was smaller than full screen).

    Ironically, scrolling does not always cause paint this over - it seems that the BlackBerry has a few graphics buffers that are larger than the screen. I discovered the hard way when I created a Windows type scroll bar and I saw that it is royally screwed touch screen scrolling.

    Invalidate() is good in these cases, when you change some flag or value which affect the appearance and want to force repaint them. Otherwise, BB is good enough to handle these things on its own.

  • IP address conflict? How to solve this problem. Message on the screen. go to the system event log window.

    Next message on the screen for IP address conflict. There are two addresses. How to solve this problem. Message to say go to the system event log window. I can't. Pl help.

    A common situation that can lead to a conflict of ip address, it's only 2 (or more) computers or other devices are connected to the router (via ethernet or wireless), and both have ip addresses assigned by the router automatically, one of the computers, then past in mode 'sleep', and while we sleep the router restarts.  When the router comes back online he doesn't know the computer sleeps is here and that he already has an assigned ip address and so it gives the ip address of the other computer.  When the computer asleep wakes duplicate error will be triggered.  It can be solved by turning off computers and turn it back on so that the router will assign them new ip addresses.  If this is not what is happening in your situation, the following may help: http://windows.microsoft.com/en-US/windows7/Get-help-with-There-is-an-IP-address-conflict-message

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

Maybe you are looking for