08-25-2009, 08:25 AM
Join Date: Mar 2008
Location: Austin, TX
Post Thanks: 0
Thanked 34 Times in 33 Posts
The UI components can only be accessed from the event thread. In order to do what you are trying to do, you would have to place this UI operation in a Runnable, and pass this to UiApplication.invokeLater().
Having said that, I don't see the benefit in having this timer thread arbitrarily updating the progress bar.
Also, I have never called "doPaint" in 1 million lines of Blackberry code - not sure what you are trying to do here.
Why not do something a little simpler?
1. Put the HTTP in a sep. thread
2. Arrange a callback mechanism so the thread can call back to your Screen class
3. Push a modal dialog, "Downloading...please wait"
4. In your callback, use InvokeLater to pop this modal dialog. (remember, this IS NOT the UI thread)
Now, your next line of code after the modal dialog push will execute once the HTTP request is complete.
Last edited by Dougsg38p : 08-25-2009 at 08:27 AM.