title: Android AlertDialog in libgdx not reacting to click
body: <p>I am trying to show an <code>AlertDialog</code> inside a class extending <code>AndroidApplication</code> (which is a libgdx-class that extends <code>Activity</code>). The code looks as follows</p>
  
  <pre><code>import android.app.AlertDialog;
  
  public class Solitaire extends AndroidApplication{
  
  public void alertBoxWonMessage() {
      AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(Solitaire.this);
  
      // set title
      alertDialogBuilder.setTitle(R.string.won_title);
      // set message and positive button
      alertDialogBuilder
              .setMessage(Html.fromHtml("Total time: " + timeForAlert(time) + "&lt;br&gt;" + "Total Points: " + pointsView.getText().toString()))
              .setCancelable(false)
              .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int id) {
                      // if this button is clicked, close
                      // current activity
                      Log.d("Hi", "hi");
                      dialog.dismiss();
                      exit();
                      Solitaire.this.finish();
                  }
              });
  
      // create alert dialog
      AlertDialog alertDialog = alertDialogBuilder.create();
  
      // show it
      alertDialog.show();
  }
  }
  </code></pre>
  
  <p>The dialog is shown and fine, but there is no animation when clicking the positive button and the code inside <code>onClick</code> is not executed. Neither is anything written to the console (I also tried <code>Gdx.app.log(...)</code> and <code>System.out.println(...)</code> instead of <code>Log.d(...)</code>, but nothing), nor the dialog dismissed or the Activity closed.</p>
  
  <p>Moreover it seems to be using a lot of memory (computer gets really slow) and printing the following lines to the console:</p>
  
  <pre><code>E/EGL_emulation: tid 5206: eglSurfaceAttrib(1174): error 0x3009 (EGL_BAD_MATCH)
  W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x9488e800, error=EGL_BAD_MATCH
  </code></pre>
  
  <p>I thought it wasn't a problem, because I found some people with the same problem and they were told, that this was not a problem, but maybe it is.</p>
  
  <p>So, any ideas?</p>