• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ProgressDialog.show dosent show ProgressBar Immediately

 
Robert Darling
Ranch Hand
Posts: 100
Android Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 9577
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us the rest of the code...
 
Piyush Patel
Ranch Hand
Posts: 127
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic