Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Trusted Contributor
Posts: 130
Registered: ‎08-10-2010
My Device: Not Specified

Still got IllegalStateException after synchronizing the event log

Hi,

 

I've been running into this annoying IllegalStateException these days, when trying to invoke setText() method of some fields. Interestingly, it used to work a few days before.

 

Now, even if I synchronize the event lock before doing so, I still get the IllegalStateException.

 

synchronized(UiApplication.getEventLock()){

            EditField.setText("abc");       

}

 

Can someone help on this?

Trusted Contributor
Posts: 130
Registered: ‎08-10-2010
My Device: Not Specified

Re: Still got IllegalStateException after synchronizing the event log

In fact, I'm trying to change the screen of another application, which is stored in RunTimeStore.

 

I've tried the code example in KB article http://supportforums.blackberry.com/t5/Java-Development/Update-a-screen-on-the-Main-Event-Thread/ta-....

 

Still not working.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Still got IllegalStateException after synchronizing the event log

It would be useful to know the description of the IllegalStateException.  I suggest you print it out when you get one of these, it will help in the diagnosis.

 

In this case, I'm pretty sure the problem is caused because you are trying to update the Screen associated with another application.  If you want to update that Screen you will have to 'context switch' to that other application.  The easiest way to do this is to send the other Application a Global Event, and have the other Application, as a Global Event Listener, update its own screen.