title: How do you disable a button inside of an AlertDialog? Follow Up Question
body: <p>I asked this question yesterday (http://stackoverflow.com/questions/7392321/how-do-you-disable-a-button-inside-of-an-alertdialog) and modified my code accordingly... this morning I ran the code in an emulator and received an NPE. Here is the code:</p>
  
  <pre><code>public void monster() {
          int playerint = settings.getPlayerInt();
          int monsterint = settings.getMonsterInt();
  
  
  
          AlertDialog.Builder alertbox = new AlertDialog.Builder(this);
          alertbox.setMessage("You have Encountered a Monster");
  
          alertbox.setPositiveButton("Fight!",
                  new DialogInterface.OnClickListener() {
  
                      // do something when the button is clicked
                      public void onClick(DialogInterface arg0, int arg1) {
                          createMonster();
                          fight();
  
                      }
                  });
  
          alertbox.setNeutralButton("Try to Outwit",
                  new DialogInterface.OnClickListener() {
  
                      // do something when the button is clicked
                      public void onClick(DialogInterface arg0, int arg1) {
                          // This should not be static
  //                      createTrivia();
                          trivia();
  
                      }
                  });
  
          // Return to Last Saved CheckPoint
          alertbox.setNegativeButton("Run Away!",
                  new DialogInterface.OnClickListener() {
  
                      // do something when the button is clicked
                      public void onClick(DialogInterface arg0, int arg1) {
  //                      runAway();
                      }
                  });
  </code></pre>
  
  <p><em><strong>THIS IS WHERE THE PROBLEM STARTS</em></strong> </p>
  
  <pre><code>// show the alert box
              alertbox.show();
              AlertDialog dialog = alertbox.create();
              Button button = dialog.getButton(AlertDialog.BUTTON_NEUTRAL);
              if(monsterint &gt; playerint) {
                  button.setEnabled(false);
              }
          }
  </code></pre>
  
  <p>Anyone know what I am doing wrong?</p>