title: How to show a "Loading..." dialog in android?
body: <p>How to create a dialog to show loading in android? I want to show a dialog with "Loading..."  while an aynctask i running. I tried with an activity with <code>Theme.Dialog</code>. Please help.</p>
  
  <p>my code:</p>
  
  <pre class="lang-java prettyprint-override"><code>private class getlisttask extends AsyncTask&lt;Void, Void, String&gt; {
      @Override
      protected String doInBackground(Void... arg0) {
          SourceURL srcGrabber = new SourceURL ();
          String result = "";
  
          try {               
                Url = Url + usr + "&amp;qry=" + query;
                result = srcGrabber.grabSource(Url);               
          } catch (Exception e) {
              Log.e("Exception", e.tostring());
          }
  
          return result;
      }
  
      @Override
      protected void onPostExecute(String result) {
          TextView txtView1 = (TextView) findViewById(R.id.TextView);
          txtView1.setText(result);
      }
  }
  </code></pre>