title: How to handle UI in asynctask?
body: <p>Generally I  update UI in postExecute method.<br>
  e.g.</p>
  
  <pre><code>public class SampleActivity extends Activity{
  TextView textSample;
  @Override
  public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
  
          setContentView(R.layout.aadd_addtocheck);
          textSample = (TextView) findViewById(R.id.lin);
                  STask sampleTask = new Stask();
                  sampleTask.execute();
  }
  class GetAdd extends AsyncTask&lt;Void, Void, JSONObject&gt; {
  
  
          @Override
          protected JSONObject doInBackground(Integer... params) {
              // TODO Auto-generated method stub
              UserFunctions u = new UserFunctions();
              return u.getNewAdd();
          }
  
          @Override
          protected void onPostExecute(JSONObject result) {
              super.onPostExecute(result);
                      textSample.setText(result.getString("Something");
  }
  </code></pre>
  
  <p>However, my asyncTask become large and I want to move them to different class (before they were a subclass). Therefor, I wonder how to to update UI ( like setting texviews) when asynctask will be a separete class.</p>