title: How access parent class view from callback function in AsyncTask?
body: <p>Here is my sample code.</p>
  
  <pre><code>public class test extends Activity {
    private TextView tv;
  
    public class Blap extends AsyncTask&lt;String,String,Boolean&gt;{
      private test parent;
      @Override
      protected Boolean doInBackground(String... options) {
          this.auth(options[0],options[1]);
          parent.aresponse(res);
          return true;
      }
      public Blap(test a){
          this.parent = a;
      }
      public auth(String login, String password){
          //process auth
      }
  }
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      //work...
  }
  
  public void buttonclick(View v){
      tv = new TextView(this);
      new Blap(this).execute(editText1.getText().toString(),editText2.getText().toString());
      setContentView(tv);
  }
  public void aresponse(String rs){
      tv.setText(rs);
  }
  }
  </code></pre>
  
  <p>But when aresponse is called, I got an exception: only the original thread that created a view hierarchy can touch its views.
  How do I correctly wait for async operation complete and continue processing needed operations?</p>