title: ProgressBar Spinner for Async Task
body: <p>Here is my simple AsyncTask : </p>
  
  <pre><code>class MyTask extends AsyncTask&lt;String, Void, String&gt; {
  
      @Override
      protected String doInBackground(String... params) {
  
          String page = null;
          try {
              page = new Communicator().executeHttpGet(params[0]);
          } catch (Exception e) {
              e.printStackTrace();
          }
          return page;
      }
  </code></pre>
  
  <p>how do I add a progress bar to this that displays a simple spinner? Every time I try the code breaks or parameters are misplaced. </p>
  
  <p>EDIT:</p>
  
  <pre><code>class MyTask extends AsyncTask&lt;String, Void, String&gt; {
  
      ProgressDialog myPd_ring = null;
  
      @Override
      protected void onPreExecute() {
  
  
          myPd_ring.show();
  
      }
      @Override
      protected String doInBackground(String... params) {
  
          String page = null;
          try {
              page = new Communicator().executeHttpGet(params[0]);
          } catch (Exception e) {
              e.printStackTrace();
          }
          return page;
  
      }
  
      @Override
      protected void onPostExecute(String result) {
          myPd_ring.dismiss();        
          super.onPostExecute(result);
      }
  
  }
  </code></pre>
  
  <p>Tried this still doesn't work ! In fact the application isn't even responding to standard input now !
  Thanks !</p>