title: progress dialog inflate on top of layout onPreExecute()?
body: <p>My ProgressDialog works in the case that i show() in my oncreate method.</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState); 
          pd = ProgressDialog.show(this, "Working", "Retreiving Neaby Restaurants", true, true);  // initializes the progress dialog
          pd.setCanceledOnTouchOutside(false);  // on newer versions of android touching outside of the screen will close the dialog. I decided to make it only cancelable when the back button is pressed.
          setContentView(R.layout.nearby_places_list);
  </code></pre>
  
  <p>However, the dialog code wont work if i use it in an async task because its not in the on create().  The arguements  show(this, "Working", "Retreiving Neaby Restaurants", true, true) arnt allowed outside of the onCreate():</p>
  
  <pre><code>class MyAsync extends AsyncTask&lt;Void, Integer, Boolean&gt;{  // this task is for populating the listview
  
          @Override 
          protected void onPreExecute() {
              //ProgressDialog.show(context, "Working", "Retreiving Neaby Restaurants");
              pd = ProgressDialog.show(this, "Working", "Retreiving Neaby Restaurants", true, true);  // initializes the progress dialog
              pd.setCanceledOnTouchOutside(false);  // on newer versions of android touching outside of the screen will close the dialog. I decided to make it only cancelable when the back button is pressed.
          }
  </code></pre>
  
  <p>This is somewhat upsetting because i wanted to show the dialog at the start of an async task but not long before that task is called.</p>
  
  <p>So my question is how do make this work inside of the async task on the onPreExecute()  I don't want to have to show() until the users actually start using the async task.</p>