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

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -