简体   繁体   中英

how to update UI by using progressdialog from several instances of asynctask

I have an activity with an inner (asynctask) class. I'm trying to create a progress dialog ,and in a "for" loop create several instances of my inner (asynctask) class. those instances supposed to update the message + progress of the progress dialog. I created the progress dialog inside the activity and showed it inside the asynctask->onProgressUpdate function.

however the progress dialog is not showing up.

Can anyone tell me if there's another way to update the UI ??

Run AsyncTask successively, one by one, and update your dialog on preExecute or postExecute . And write your for loop in doInBackground , where i is a indicator what task executed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM