AlertDialog with ListView in Android
<p>So I am starting to get into Android development with really basic applications. I'm messing around with AlertDialogs and am trying to get a list view working. I have a button that when clicked should call a function to create/display the AlertDialog. Here is the code for the button. </p>

<p><code>&lt;Button android:layout_height="wrap_content" android:text="@string/partyChoice" android:id="@+id/partyChoiceButton" android:layout_width="wrap_content" android:layout_above="@+id/shirtSizeButton" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:onClick="partyChoice"&gt;</code></p>

<p>And here is the code for the function <code>partyChoice</code></p>

<pre><code>public void partyChoice()
{
    final CharSequence[] items = {"Bowling", "Laser Tag", "Combo", "Cosmic"};

    AlertDialog.Builder builder = new AlertDialog.Builder(PartyPlannerActivity.this);
    builder.setTitle("Choose A Party");
    //builder.setIcon(R.drawable.icon);
    builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int item) {
     Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
        }
    });

    builder.setPositiveButton("Yes",
     new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int id) {
       Toast.makeText(PartyPlannerActivity.this, "Success", Toast.LENGTH_SHORT).show();
      }
     });
    builder.setNegativeButton("No",
     new DialogInterface.OnClickListener() {
      public void onClick(DialogInterface dialog, int id) {
       Toast.makeText(PartyPlannerActivity.this, "Fail", Toast.LENGTH_SHORT).show();
      }
     });
    AlertDialog alert = builder.create();
    alert.show();
}
</code></pre>

<p>This code compiles and runs with no errors, however when I go to click the button, my application force closes. I cannot find where the issue is. If anyone could help me it would be greatly appreciated.</p>
