title: Creating a dialog after onClick in listView
body: <p>I'm trying to get a dialog out of a listView. I want to let the user see a dialog with 3 font sizes so he can change the font size of the app. To get to this dialog the user has to tap on a button in a listView. I made it like this:</p>
  
  <pre><code>package com.reekapps.simplenote;
  
  import android.app.Activity;
  import android.app.AlertDialog;
  import android.app.AlertDialog.Builder;
  import android.content.DialogInterface;
  import android.os.Bundle;
  import android.app.Dialog;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.AdapterView.OnItemClickListener;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  
  public class Settings extends Activity {
  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.settings);
      getActionBar().setTitle("Settings");
  
  
  
      String[] listItems = {"Colour", "Font Size",};
      ListView lv = (ListView) findViewById(R.id.settings_list);
  
      lv.setAdapter(new ArrayAdapter&lt;String&gt;
      (this, android.R.layout.simple_list_item_1, listItems));
  
      lv.setOnItemClickListener(new OnItemClickListener()
      {
          public void onItemClick(AdapterView&lt;?&gt; parent, View
                  view, int position, long id)
          {
              String[] listItems = {"Colour", "Font Size",};
              if(listItems[position].equals("Font Size"))
              {
  
                  AlertDialog.Builder builder = new AlertDialog.Builder(getApplicationContext());
                  builder.setTitle("Choose Font Size");
                  AlertDialog alertDialog = builder.create();
                  alertDialog.show();
              }
  
          }
      });
  
  
      // TODO Auto-generated method stub
  }
  
  }
  </code></pre>
  
  <p>It doesn't show any errors but it crashes when I click on Font Size (the button to get to the dialog).</p>
  
  <p>Thank you for your time!</p>