title: DialogInterface (yes/no) inside another dialoginterface
body: <p>Hello :) I want to make a DialogInterface for buying more coins, and if you press no, It will open another DialogInterface that will ask are you sure?
  here is my code so far:</p>
  
  <pre><code>DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      switch (which){
                      case DialogInterface.BUTTON_POSITIVE:
                          //Yes button clicked
                          break;
  
                      case DialogInterface.BUTTON_NEGATIVE:
                          DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
                              @Override
                              public void onClick(DialogInterface dialog, int which) {
                                  switch (which){
                                  case DialogInterface.BUTTON_POSITIVE:
                                      //Yes button clicked
                                      break;
  
                                  case DialogInterface.BUTTON_NEGATIVE:
  
                                      break;
                                  }
                              }
                          };
                          AlertDialog.Builder builder = new AlertDialog.Builder(this);
                          builder.setMessage("Do you want to buy more coins?").setPositiveButton("Yes", dialogClickListener)
                              .setNegativeButton("No", dialogClickListener).show();       
                          break;
                      }
                  }
              };
  
              AlertDialog.Builder builder = new AlertDialog.Builder(this);
              builder.setMessage("Do you want to buy more coins?").setPositiveButton("Yes", dialogClickListener)
                  .setNegativeButton("No", dialogClickListener).show();               
          }
  </code></pre>
  
  <p>My problem is, at one of the lines:
  " <code>AlertDialog.Builder builder = new AlertDialog.Builder(this);</code> "
   I get an error  <code>The constructor AlertDialog.Builder(new DialogInterface.OnClickListener(){}) is undefined</code> </p>
  
  <p>Can someone fix it to me ? TY :)</p>
  
  <h2>FIXED</h2>
  
  <p>HERE is the solvement:</p>
  
  <p>To anyone with the same problem, change the line </p>
  
  <p><code>AlertDialog.Builder builder = new AlertDialog.Builder(this);</code></p>
  
  <p>to:</p>
  
  <p><code>AlertDialog.Builder builder = new AlertDialog.Builder(XXX.this);</code></p>
  
  <p><code>XXX</code>=Your current <code>class</code>(<code>mainactivity</code>,<code>firstactivity</code>,<code>shop</code> etc.)</p>