title: execute the async task in serial order in android4.0
body: <p>I have implemented the 2 asyn tasks, I am using android4.0. where one asyntask is executed continuously, second one is executed based on requirement(may be mulitpe times).
  For example.</p>
  
  <pre><code>class AsynTask1 exetends AsyncTask&lt;Void, Bitmap, Void&gt;{
      protected Void doInBackground(Void... params) {
          while(true){
              publishProgress(bmp);
          }
      }
  }
  
  class AsynTask2 extends AsyncTask&lt;String, Void,Void&gt;{
      protected Void doInBackground(String... params){
          System.out.println(params[0])
      }
  }
  </code></pre>
  
  <p>In activity class</p>
  
  <pre><code>class MainActivity extends Activity{
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          new AsynTask1().execute();
  
          int i=0;
          while(i&lt;100)
          {
              if(i%2==0)
              new AsynTask2().execute("no is even"+i);
              i++
          }
      }
  }     
  </code></pre>
  
  <p>In the above case the AsynTask2 is not executed . </p>
  
  <p>If tried with executeOnExecutor(AsyncTask.THREAD_POOL_Executor,params), then both asyntask are executed and I am getting the print messages from the AsynTask2, but those are not in order(like 0 2 6 4 10 8 12 14 ....).</p>
  
  <p>Is there any way to execute the AsynTask1 continuously and AsynTask2 in Sequential order so that the order(like 0 2 4 6 8 10 12 14....) is prevented.</p>
  
  <p>Thanks &amp; Regards
  mini.</p>