How to cancel ProgressDialog after finishing all threads?


I have 30 threads (AsyncTask) executed in the same time. Before execute them, I will show progressdialog. After threads finish execution, I will dismiss progressdialog.

Any suggestion on How to dismiss ProgressDialog after finish all threads?

If you are using exact 30 threads then initialze a variable with 30 and after every task completion decrease the count by one and also check if the variable is zero . if it is zero it indicate that all the tasks has been completed. so you can dismiss the ProgressDialog.