title: ProgressDialog closing onClick
body: <p>I start an <code>AsyncTask</code> to load a file that takes some time. To inform the user I'm showing a <code>ProgressDialog</code>, however if I touch the screen the <code>ProgressDialog</code> closes immediately. What could be the cause of this?</p>
  
  <pre><code> public LoadTask(Activity activity, FaceRecognizer recognizer,SecretKey key) {
      this.key = key;     
      this.recognizer = recognizer;       
      dialog = new ProgressDialog(activity);
  
  }
  
  @Override
  protected void onPreExecute() {
      dialog.setMessage("Loading the recognizer...");
      dialog.show();
  }
  
  @Override
  protected Boolean doInBackground(Void... params) {
      recognizer.load(key);
      return null;
  }
  
  @Override
  protected void onPostExecute(Boolean result) {
  
      if (dialog.isShowing()) {
          dialog.dismiss();
      }       
  </code></pre>