pushGlobalScreen of background application give runtime exception.

Hi all

I've implemented an application extending application. making background app.

also, I updated the property system and auto-start module.

Now, I want to display a message to the screen. to do this, I used following code...

showMessage (final String mesg) {}

Bitmap.getPredefinedBitmap (Bitmap.EXCLAMATION);
UI UiEngine is Ui.getUiEngine ();.
Screen = new (Dialog.D_OK, mesg dialog box,
Dialog.OK, Bitmap.getPredefinedBitmap (Bitmap.EXCLAMATION),
Manager.VERTICAL_SCROLL);
ui.pushGlobalScreen (screen, 1, UiEngine.GLOBAL_MODAL);

}

If I put this code before appMain.enterEventDispatcher (); then it will run correctly and without error.

When I call the showMessage method after appMain.enterEventDispatcher (); then it will give runtime error.

My requirement is to read the udates server and then display the message. So I can't do it before appMain.enterEventDispatcher (); in the main method.

I am getting following error

java.lang.RuntimeException: pushGlobalScreen (modal) called by a thread of non-event

How can I solve this error?

Is there no work around to do the same thing...

Waiting for response...

Help, please

Thank you

Ashish...

Replace this statement:

ui.pushGlobalScreen (screen, 1, UiEngine.GLOBAL_MODAL);

with this statement:

Application.getApplication().invokeLater(
  new Runnable() {
    public void run() {
      ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_MODAL);
    }
  }
);

Tags: BlackBerry Developers

Similar Questions

  • Dialog.Alert give runtime exception

    Hi all

    I have a scenario, whiich am thrown in runtime exceptions.

    I placed a dialog.alert to show the user an alert after a validation. It works fine, but once when I cllicked on the ok button, it TR throwing a runtime exception. She did not understand why clicking on the alert of dialogue in which run-time exception.

    In some screens, he of not throwing the error and works very well.  I have observed that, the error is thrown in cases where a custom editfield is added to the screen.

    Please explain to me why this is happening and how to understand it. .?

    Thanks to everyone for your interest!

    After a long vacation... so this thread remains as it is. I found the mistake during debugging. There is no detailed msg that are associated with. and it is originally due to "TouchEventInjector" will be void. I haven't heard of him until now.

    I don't know yet why it start error.

    but I solved my problem by pushing an anti-pop as alert msg.  I wl mrk this thread as solved after awhile, looking for ideas about this error.

  • Runtime Exception while simulating sms send device/network CDMA

    I'm trying to simulate the sending of a sms of my application. Since the device during the simulation simulates CDMA network, I use DatagramConnectionBase to send sms.

    Whenever my application tries to send a text message it throws JVM 104 error: Runtime Exception.

    I use Eclipse to develop the application and we tried to simulate this on different Blackberry JDE pluggins, including v5.0, v4.7.0, v4.6.0 and the result is always the same. Just this part crashes me to begin to test my application.

    Thank you.

    The section of the code of the application that sends sms is:

    DatagramConnectionBase _connection = null;
    DatagramBase _sms = null;
    Try
    {
    _Connection = (DatagramConnectionBase) Connector.open ("sms: / /: 0");
    _sms = (DatagramBase) _connection.newDatagram (_connection.getMaximumLength ());
    _sms.setAddress ("sms: / /" + _mobileNumber);
    _sms. Write (_smsContent.GetBytes (), 0, _smsContent.getBytes () .length);
    _Connection.send (_sms);
    _Connection.close ();
    }
    catch (IOException e)
    {
    System.out.println ("' sending Txt Message on CDMA network Exception:" ")
    + e.getMessage ());
    }

    OK... I found the way to make it work.

    Thank you all.

  • finishLoading() Runtime Exception

    Eclipse jre 4.5 win7

    Hi guys. I create the browser in my application. If launch browser app startup then ok.

    But when I press the button (specil for browser displays with other URLs) I have error "Runtime Exception".

    IM using debuger for it and he showed me error on browserContent.finishLoading ().

    What should I do to correct work? When I pressed the button to go to a different url.

    IM reading on non-main thread... but I do not know code... And do not know where I wrote it.

    Can someone help me and show me some code. I really need help here. Please

    Best regards, Peter.

    Solved

  • Runtime exception: ApplicationRegistry.waitFor () timeout

    We have a device 8800 (firmware 4.1.2.79) with a runtime exception whenever on the battery reset. Morganphone is an in-house application built on JDE 4.1.0.  This device also shows the same exception of ApplicationMenuItemRepository.addMenuItem on another application inhouse.  I suspect it is device-specific, but what causes this runtime exception?

    Name: RuntimeException

    GUID: 9c3cd62e3320b498

    Time: August 6, 2008 09:33:48

    ApplicationRegistry.waitFor (0x1c83a547b3934c66) timeout

    net_rim_cldc-4

    ApplicationRegistry

    0x483D

    net_rim_cldc-4

    ApplicationRegistry

    waitFor

    0 x 4710

    net_rim_cldc-4

    ApplicationRegistry

    waitFor

    0x467B

    net_rim_bb_apps_framework-2

    TaskCollectionHolder

    getTaskCollection

    0x265C

    net_rim_pdap-1

    ToDoListImpl

    0x8E9

    net_rim_cldc-1

    Class

    newInstance

    0 x 2186

    net_rim_pdap

    ToDoListFactory

    createToDoList

    0xCDA5

    net_rim_pdap

    PIMImpl

    openPIMList

    0xA13D

    net_rim_bbapi_menuitem

    SdkProxyVerb

    0 x 897

    net_rim_bbapi_menuitem

    ApplicationMenuItemRepository

    ToolBarMenuButton.AddMenuItem

    0x27F

    net_rim_bbapi_menuitem

    ApplicationMenuItemRepository

    ToolBarMenuButton.AddMenuItem

    0xDC

    com_ms_morganphone

    MorganPhone

    main

    0 x 1265

    Thank you

    June Jorgensen

    Thanks for the explanation. Detective Conan.

    June

  • error message: scvhost.exe - Application error: the exception unknown software exception (0xc06d007e) occurred in the application at location 0x7c812afb.

    I closed my computer and he says there are a few updates that should be installed in front of him close. I let it run and my computer off. Now, when I turn it back on I get the following error message: scvhost.exe - Application error: the exception unknown software exception (0xc06d007e) occurred in the application at location 0x7c812afb. And now I can't get my computer to connect to a wired or wireless internet connection, and it seems to be running slow. Any ideas what it is or how to fix it?

    Also, I tried to restore my computer to a few days ago and running my software virus and nothing is changed.

    Hello

    Have updates you installed? You can check this in the history of the update?

    Step 1: To check the update history, follow these steps:

    1. Click Start, click all programs, and then click Windows Update or Microsoft Update.
    2. on the Windows Update Web site or the Microsoft Update Web site, click on view update history.

    Step 2: Refer the article that could help you solve this problem.

    You receive an error message after a Windows XP-based computer runs an automatic update, and you may be unable to run any programs after the closure of the "svchost.exe - Application error" error message dialog box
    http://support.Microsoft.com/kb/927385

  • How to call BlackBerryContactList.choose () of the background application

    I am facing a problem while call BlackBerryContactList.choose () to background application (process) nothing happens.

    Below is the code

    List of BlackBerryContactList = (BlackBerryContactList) PIM.getInstance () .openPIMList (PIM. CONTACT_LIST, PIM. READ_WRITE);
    Choose PIMItem = list.choose ();

    When you call a user interface application works well, but even does not work when the application background.

    Please help me...

    This dialog works separately from your Application.  It is not actually a part of your Application.  It is a Global screen.  It works very well.

    But to use the dialog to choose, I think you should return control in your application, and as you've found, I think that you need to bring your application to the foreground in order to ensure that he choose the dialog box is displayed.  This means that you have to run a UiApplication, not a request.

    To make sure that it can request not bought to the forefront accidentally, you can set acceptsForeground() to false.

    But when you want to use the Choose dialog box, you will need to have this method returns true and then put your Application in the foreground.  When you get the answer to choose, you can set it to false and again take your application in the background.

    I suggest while you develop it you just create a UiApplication standard and make it work like that.  Then try to simulate an application by adjusting the acceptsForeground() at the right times.

    Since your application will in fact be a UiApplication, I suggest you have a too associated screen.  A simple splash screen will do.

    I hope this helps.

    PS > there is a small chance that you can requestForeground on your Application when you call the method of choice and it appears.  Try it.  But I will not be surprised if it fails.

  • How to retrieve the touch of background application coordination.

    Hi guys,.

    Is it possible to recover some contact details by background application (Os 7.1)?

    Thank you

    Well, can mark you this as resolved then?  Instructions help link located at the top of the screen if you need.

  • Problem with background application.

    Hi all

    I develop background application, which always runs in the background. If the application then restart my app starts to reboot. But for some unknown reason, to leave you my request. But I am unable to know the reason why is output.

    Can someone help me please in this?

    -Shekhar.

    On the device, tap L G L G

    Or, you can download the appliance event log using javaloader.

  • KeyPress events for background application

    Hi all

    I need to develop the following features:

    When a certain key sequence is pressed [say #data #], an application must be called

    The background application can check for such a sequence and start the event.

    However, the question is, if an application can have access to key events when he is not on top of the stack in the user interface. In addition, such a feature may be possible when another application [say a native application such as Message or address book] is running.

    I personally don't think it is possible, however, if someone met an implementation of the similar device or method to achieve, then it would be really great.

    Thank you and best regards,

    Basilio J V Souza

    This is possible if the user interface for your application is in the foreground.  If this is the case, you can use this technique:

    Use a sequence of backdoor

    http://supportforums.BlackBerry.com/T5/Java-development/use-a-backdoor-sequence/Ta-p/445180

  • HomeScreen.updateIcon updates the bad background application

    I have an application with two entry points. A single point of entry runs as a background application to listen to calendar changes. When the Exchange Calendar I need to change my icon on the home screen to the GUI of my app app part. However, if I am in another application when the event occurs, the current application has its icon has changed.

    I know that there is another version of updateIcon() in 4.7, but how do I handle this in older versions of the operating system?

    Use a global event to send a message to your Application that the calendar has changed.  Your application can then some he wants, including the amendment of the application icon.

    What is - world events and global event listeners
    Article number: DB-00145
    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800620/What_Is...

  • Need to know about the background application

    Test Simulator with JDE version 5.0. I work at the request of the alarm. So I created a background application, where I look in the database and perform the necessary task vibrant just the phone. I have another point with nongui param. Its works fine. Now the problem is, I set an alarm for once, now is the time and the alarm goes off and the user he repeated for 10 minutes, average while I just still run my application in the menu of the eclipse without closing the Simulator, I was expecting that the alarm that was repeated should get fired, but it won't. the problem always occurs when I run the application without closing the Simulator. So what can be the reason for this, and if I just closed Simulator and run it from the eclipse menu its new working fine means repeated when time comes it vibrates the Simulator can someone explain me what are the problem here.

    Do not disable not either sorry here...

    Your code looks fine.

    You can run this code too early.  You probably need to wait until the device is completely upward before you check this:

    http://supportforums.BlackBerry.com/T5/Java-development/write-safe-initialization-code/Ta-p/444795

  • Runtime exception

    I m do runtime exception when I m trying to display the dialog box in an extendind screen or UIApplication class

    I can't find any technique/syntax error

    no idea... my code snippet is:

    public MemoScreen(){
            super();
            util = new UtilityClass();
            setTitle(UtilityClass._resources.getString(MEMO_SCREEN_TITLE));
            try {
                _memoList = (BlackBerryMemoList) PIM.getInstance().openPIMList( BlackBerryPIM.MEMO_LIST, BlackBerryPIM.READ_WRITE );
            }catch ( PIMException pe ) {
                System.exit( 1 );
            }
    
            _memoListField = new ListField();
            _memoListField.setCallback( this );
            loadMemos();
            add( _memoListField );
            if(util.applicationRunnableStatus()==false){
                Dialog.alert("Trial period over !");//Exception occures here
            }
        }
    

    where MemoScreen extends class form...

    any strick?

    Solved!

    dialog box displayed just invokeLater()...

  • Rebecca.exe - Application error the exception unknown software exception (Oxe0434352) occurred in the application at location Ox46ca5bf8

    Rebecca.exe - Application error the exception unknown software exception (Oxe0434352) occurred in the application at location Ox46ca5bf8

    You have any suggestions on how to fix or repair the previous message? I have a HP Pavilion e037cl-15 Notebook PC. HP recovery all does not work. The program crashes.  I am unable to run the system, the system recovery restore.

    Hi Carol,.

    The application that this question is HP Recovery Manager from HP. I suggest you try to uninstall and reinstall the recovery program HP Manager and check if it works for you.

    Refer to the following article from HP to remove HP Recovery Manager.

    http://h10025.www1.HP.com/ewfrf/wc/document?cc=us&LC=en&DLC=en&docName=c00810298

    See the following article from the HP to install HP Recovery Manager.

    http://h10025.www1.HP.com/ewfrf/wc/softwareDownloadIndex?cc=us&LC=en&DLC=en&softwareitem=ob-67257-1

    If the problem persists, then it would be better to post the same question in the HP Support forum for more help on this issue.

    http://WWW8.HP.com/us/en/supportforums.html

    Please do not hesitate to visit our Web site for any help with the Windows operating system.

  • API - application of the exception

    Hello

    I have the class of exception as below
    public class APDUException extends CardRuntimeException {
    
        private static APDUException systemInstance;
        public static final short ILLEGAL_USE = 1;
        public static final short BUFFER_BOUNDS = 2;
        public static final short BAD_LENGTH = 3;
        public static final short IO_ERROR = 4;
        public static final short NO_T0_GETRESPONSE = 0xAA;
        public static final short T1_IFD_ABORT = 0xAB;
        private short[] theReason;
    
        public APDUException(short reason) {
            super(reason);
            if (systemInstance == null) // 
            {
                systemInstance = this;
            }
            theReason = JCSystem.makeTransientShortArray((short) 1, (byte) JCSystem.CLEAR_ON_RESET);
            theReason[0] = reason;
        }
    
        public static void throwIt(short reason) {
            systemInstance.setReason(reason);
            throw systemInstance;
        }
    
        public short getReason() {
            return theReason[0];
        }
    
        public void setReason(short reason) {
            theReason[0] = reason;
        }
    There is no problem if it's a normal exception class.
    But in java card, the exception is subject to temporary entry point. And the rule is that we cannot keep its reference to class variables, instance variables.

    If the above application differs from the temporary entry point object property. (the "systemInstance" causes this problem)

    However, "systemInstance" is necessary because without it, we cannot apply "throwIt" method, because it must call the non-static method «setReason (...)»

    I hope you understand my point. And if you have any comments, suggestions on the application of the exception?

    All the best,

    Mike

    If it's the JCRE the instance property, it will be in RAM, if it's an applet the instance property, it will be in the EEPROM.

    See you soon,.
    Shane

Maybe you are looking for

  • Satellite X 200-HD - DVD reading problems

    Hello I recently acquired a Satellite X 200.I decided to upgrade to the latest drivers and applications available on the website of Dutch support.Since I now have my first HD-DVD player, I also bought the latest Harry Potter on HD - DVD. Reading with

  • Problem of DVD on a Satellite 1950 801

    Hello DVD player (Mat * a UJ - 810) of my Toshiba Satellite 1950 801 recently stopped recognizing any DVD inserted media (rewritable, registered or manufactured). However, it seems to work correctly with the CD, CD - r and CD - RWs. everything also s

  • HP Elite book 840 G1: is there a default password of Bios administrator for the G1 ELitebook 840 series

    I am trying to upgrade to windows 10 but unfortunately, the system came with a bios password that nobody seems to know

  • XP32/XP64 - updates for XP32 killed XP64

    I installed XP64 on a new HARD drive. XP32 remained on its original HARD disk. All available for XP64 updates have been installed. It was indeed a new system for XP32 needed to be reactivated - fact. New MB drivers should also be installed. BTW, this

  • The SWR30 is really waterproof up to 1.5 m?

    Went swimming today and now I can barely hear anyone on the speaker. On the highest volume, they are as strong as the speaker internal speaker on my Z1C (that is to say, barely audible unless I hold the SWR30 against my ear). Anything less and they a