Cannot close progressDialog after AsyncTask is complete
<p>I first show a progressDialog and then kick off a Thread from my Activity to get a url. I pass a handler also from Activity to the Thread's request listener, and then when the Thread is complete, control is passed to a requestListener, in the requestListener, I call an asynctask to get another URL, finally when this is complete, I call the handler to show a success Dialog on the original Activity.</p>

<p>The success dialog shows fine, which means that the handler really is running on the UI thread, but I cannot get a reference back to the progressDialog.</p>

<p>I've tried : passing the pDialog to the Handler, referring to it from a global application state, setting it as a static member of Activity.</p>

<p>But the progress dialog is always null....what is going on??? Why can I show the success dialog from the Handler, but not get a handle to the progressDialog</p>

<p>I have solved this issue...</p>

<hr>

<p>I had:</p>

<pre><code>public void showProg() {
  pDialog = new ProgressDialog(this);
  pDialog.setMessage(getString(R.string.loading));
  pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
  pDialog.show();
}
</code></pre>

<p>and when I move the contents of this method outside to the same place I was calling it...every works.....what is up???</p>
