| Author |
ProgressDialog.show dosent show ProgressBar Immediately
|
Robert Darling
Ranch Hand
Joined: Jun 21, 2008
Posts: 100
|
|
Hi,
I have this code on the click event of a button. When i click on the button i want to show a progress dialog while on the very next line a new thread is created that data from the server . I call the dismiss method on the above variable from within the tread to dismiss the dialog. The problem is i have found that the dialog dose not run straight afaw but only after the thread completes does the dialog box start showing. How i can i fix this ?
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9191
|
|
|
Can you show us the rest of the code...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
Piyush Patel
Ranch Hand
Joined: Feb 24, 2009
Posts: 127
|
|
hi,
Progress bar counting is implemented using thread (second thread) using Handler.
This example uses a second thread to track the progress of a process (which actually just counts up to 100). The thread sends a Message back to the main Activity through a Handler each time progress is made. The main Activity then updates the ProgressDialog.
View this Example and click on Example ProgressDialog with a second thread. this will help you.
Best regards,
Piyush
|
[My Blog] [ Follow @Twitter] | Innovations never goes out of Style...
|
 |
 |
|
|
subject: ProgressDialog.show dosent show ProgressBar Immediately
|
|
|