title: Periodically Executing AsyncTask Class object: Updated
body: <p>what is the best way to start AsyncTask again after it has completed.
  My application is where I need to do some background processing that updates UI every 30 secs or so.</p>
  
  <p>So will this be good</p>
  
  <pre><code>MyAsyncTask t;
  
  onCreate(){
   postDelayed(myrunnable,..)
  }
  
  myrunnable(){
  if(t &amp;&amp; t.getStatus()== FINISHED){
  t = new MyAsyncTask();
  t.execute()
  
   postDelayed(myrunnable,30000)
  }else
  postDelayed(myrunnable,2000)
  }
  </code></pre>
  
  <p>Update:Edited the code, So if this sequence seems valid please say yes or suggest changes</p>