android - Pausing an enhanced for loop -


i using enhanced loop , switch statement trigger various asynctasks. how can pause each iteration of loop wait until given asynctask compeleted? trying spawn thread , wait / join / notify when each asynctask complete keep freezing ui. below code snippet...

for (integer integer : sequence) {      switch (integer) {         case 1: // async process             break;         case 2: // async process             break;         case 3: // async process             break;         case 4: // async process             break;         default: break;           }          //need magic solution here...      } 

loop not choice. add 'finish' callback after each asynctask(). create kind of chain of code. can save last added in chain can add new item in chain.


Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -