title: Do not close the alertdialog by clicking on a button - Android
body: <p>I've an alertdialog any options and with 2 buttons. I don't want close the dialog when I push on the second button (only stop a sound).</p>
  
  <p>Is there any property to maintain the dialog open?</p>
  
  <p>Thank you so much!</p>
  
  <p>Code:</p>
  
  <pre><code>        public void creaDialogTo(){
  
              final String[] tonos = {"thinks.mp3", "life.mp3", "war.mp3"};
  
              AlertDialog.Builder builder = new AlertDialog.Builder(this);
  
              builder.setTitle("Select");
              builder.setCancelable(false);
              builder.setSingleChoiceItems(tones, -1,new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int item) {
                      tone=tones[item];
                      sound1 =new SoundManager(getApplicationContext());
                      sound1.loadSound(tones[item]);
  
  
                  }
              });
              builder.setPositiveButton("Confirm",
                      new DialogInterface.OnClickListener() {
                          public void onClick(DialogInterface dialog, int id) {
                              pref.setTone(tone);
  
                              sound1.stopsound();
  
                          }
                      });
              builder.setNeutralButton("Stop sound",
                      new DialogInterface.OnClickListener() {
                          public void onClick(DialogInterface dialog, int id) {
                          sound1.stopsound();
  
                          }
                      });
              AlertDialog alert = builder.create();
              alert.show(); 
  
      }
  </code></pre>