title: android asynctask with threading
body: <p>I created an asynctask and in its doInBackground() method i started a thread like this:</p>
  
  <pre><code>private class myAsyntask extends Asynctask{
  
      doInBackground(){
      Thread t = new Thread(new Runnable(){
       public void run()
       {
          while(someBoolean!=true){
          Thread.currentThread.sleep(100);
          } 
       }
       });
      }
     onPostExecute(){
    //do something related to that variable
    }
  }
  </code></pre>
  
  <p>problem I am facing is after 1st iteration of <code>Thread.sleep()</code> , <code>onPostExecute()</code> is called , instead I thought that asynctask will run this thread on background and when that boolean is true onPostexecute() is called.I am not able to understand why this happens ?</p>