title: Why is AsyncTask Blocking UI Thread?
body: <p>Why does my AsyncTask block the UI Thread?</p>
  
  <p>My application becomes unresponsive while the AsyncTask is taking place.</p>
  
  <p>This is called in the UI Thread:</p>
  
  <pre><code>new AsyncFetch().execute();
  </code></pre>
  
  <p>This is my AsyncTask class:</p>
  
  <pre><code>class AsyncFetch extends AsyncTask&lt;Void, Void, String&gt; {
  
      @Override
      protected String doInBackground(Void... args) {
          String data = null;
          try {
              data = DataHandler.httpFetch(DataHandler.API_URL);
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
          return data;
      }
  
      protected void onPostExecute(String data) {
          DataHandler.AsyncFetchResult(data);
      }
  
  }
  </code></pre>