title: How to get AsyncTask Completed Status From Non Activity Class
body: <p>I want to wait until my <code>AsynTask</code> is finished before continuing on.
  The status always shows as <strong>RUNNING</strong> however.
  How can the <code>AsyncTask</code> signal back that is has finished?
  Why is my while loop endless? I thought that once <code>onPostExecute()</code> is called on the task
  the status gets changed to FINISHED.</p>
  
  <pre><code>private void methodOne(Context context) {
  
  MyNewTask getMyTask = null;
  
      try {
  
  
          getMyTask = new MyNewTask(context, null, null, param1);
  
          getMyTask.execute(getUrl());
  
          while(getResourceTask.getStatus().equals(AsyncTask.Status.RUNNING)){
  
              Log.i("log", "STATUS : " + getMyTask.getStatus());
          }
  
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>