title: How close the alert when I click on the button "Yes"
body: <p>I´m trying to close an alert when I click on the "Yes" button. The button interface executes a process during 10 seconds aprox. I would like to close the alert dialog when I click on the button because the alert is closed only when the SaveRoute method is finished. My code:</p>
  
  <pre><code>imageRouteDetSave.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
  
          //** Save the current route             
          new Thread(new Runnable() {
                  public void run() {
  
                           MyActivity.this.runOnUiThread(new Runnable() {
                                  public void run() {
                                      alertDialog = new AlertDialog.Builder(MyActivity.this).create();
                                      alertDialog.setTitle("Saving...");
                                      alertDialog.setMessage("......");
                                      alertDialog.setButton("Yes", new DialogInterface.OnClickListener() {
                                         public void onClick(DialogInterface dialog, int which) {
  
  
                                            alertDialog.dismiss(); //-- No close the dialog
                                            SaveRoute();//-- Big proccess
  
                                         }
                                      });
  </code></pre>