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.
12-22-2011 10:29 AM
When my app is launched, or resumes after a phone call etc... I would like to perform a few tasks in the activate() method. First I would like to start a new Thread to call a few web services, and when it's done I would like to update the UI.
I already tried to do this. I created a new class that extends Thread, in the run() method I placed all the relevant web service calling code, and in the activate() method of my main Thread I did:
MyThread myThread = new MyThread();
But I noticed that nothing seems to be getting done. So I simplified my code by removing all the web service calls from the run() method and replacing it with a wait(500) method, followed by a method call to update UI (in this case it just creates a new ButtonField, just for testing purposes).
But the ButtonField never gets created.
The new thread doesn't seem to be starting at all.
Thanks a lot.
Solved! Go to Solution.
12-23-2011 01:39 AM
Have you tried setting breakpoints or using println to trace the execution?
Firstly, is activate() even being called?
Second, is run() being reached?
When the thread does the UI work, if you've got that in a synchronized block try an invokeLater block instead.