aspose file tools
The moose likes Android and the fly likes ProgressDialog.show dosent show ProgressBar Immediately Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Mobile » Android
Reply Bookmark "ProgressDialog.show dosent show ProgressBar Immediately" Watch "ProgressDialog.show dosent show ProgressBar Immediately" New topic
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
    
    2

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...
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: ProgressDialog.show dosent show ProgressBar Immediately
 
Similar Threads
Problem with sessionScoped
How is modality implemented?
Dialog for Input in JSP
Grails Tutorials Available.
JDialog closed then when reopened data not collected/showed.