09-18-2010 03:42 AM
Can someone help me with Progress Dialog till I get the data from Http Connection?
I have tried to use Status.show but how will I dismiss that once I have the data. Once I have the data I want to update UI. I think it should be the combination of Thread and UiApplication.getApplication.invokelater, but if someone can guide me in the right direction then it will be of great help.
Solved! Go to Solution.
09-20-2010 02:44 AM - edited 09-20-2010 02:45 AM
Thanks for pointing me to that tutorial. Why is the call like runThis.run() method. start() method of thread should be called and not directly its run() method in PleaseWaitPopUpScreen.
Can anyone explain me this? Its a bit confusing so any clarification will be of great help.
09-20-2010 04:07 AM
As it says in the referenced article
"applications are not allowed to block the Event Thread".
You might find this useful:
09-22-2010 02:28 AM
Thanks for pointing to that video, but I understand what is Event Thread.
I wanted to know why the meaning of runThis.run() being called in "PleaseWaitPopupScreen". There's no meaning of implementing Runnable then if we are directly calling its run() method rather than starting thread with start() method. And I think there's no need for implementing Runnable in GetURL since the popup is displayed in another thread and then we call the URL and then popup is removed.
Anyways that tutorial helped in solving my problem.
09-22-2010 04:41 AM
What is GetURL?
This statement is not correct:
"There's no meaning of implementing Runnable then if we are directly calling its run() method"
I recommend that you review the API and looks for things that implement Runnable.
Classes implement Runnable, so that the class can be used in other processing and that processing knows it can execute the supplied classes run method. In the KB article, the Runnable is passed in to showScreenAndWait() and a separate Thread is created in that processing. Since the showScreenAndWait() processing creates a separate Thread, it does not need to be passed in a complete Thread, it only needs to know how to run the code, so Runnable is perfect.
You could pass in to showScreenAndWait() a Thread, a MenuItem, a TimerTask, or anything else that implements Runnable.
The same concept (passing a Runnable) is used with the standard
Note also this statement is not 100% accurate::
"we call the URL"
It is the Thread created by showScreenAndWait() that invokes the Runnable. I think by 'we' in the above you meant your own processing.
Hope that clears up the mystery.