AlertDialog Closing on Overlay Click
<p>Trying to debug a bit of code. I have a AlertDialog with a positive and negative listener set. On an Android 2.3.3 device everything works as expected. A user has to choose between two options in order to continue. However, on my 4.1.1 device a user can click anywhere on the screen to dismiss the dialog. Not sure what is getting called that is dismissing the dialog box. I've looked at <a href="http://developer.android.com/guide/topics/ui/dialogs.html#AlertDialog" rel="nofollow">Android AlertDialog</a> and <a href="http://developer.android.com/reference/android/app/AlertDialog.Builder.html" rel="nofollow">AlertDialog.Builder</a> but I can't find any helpful information. Any help on why this is occurring would be appreciated. The code for the dialog is below</p>

<pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(getString(R.string.titleString));

builder.setPositiveButton(this.getResources().getString(R.string.option1),
    new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
        // Things Happen Here
        dialog.cancel();
        }
    });

builder.setNegativeButton(this.getResources().getString(R.string.option2),
    new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
        // Things Happen Here
        dialog.cancel();
        }
    });

AlertDialog demoAlert = builder.create();
demoAlert.show();
</code></pre>
