title: android checkbox box issue
body: <p>i have this check box in a alertdialog. when i try to check the state of the checkbox, the application force closes. any idea why?</p>
  
  <pre><code>LayoutInflater factory = LayoutInflater.from(NewActivity.this);
          final View textDisplayView = factory.inflate(R.layout.nearestlocs, null);
          final AlertDialog.Builder newAlert = new AlertDialog.Builder(NewActivity.this);
          newAlert.setView(textDisplayView);
  
          final CheckBox checkBoxLab = (CheckBox) findViewById(R.id.checkboxlab);
  newAlert.setPositiveButton("Display on Map",
                  new DialogInterface.OnClickListener() {
              public void onClick(DialogInterface dialog, int whichButton) {
  
                  if(checkBoxLab.isChecked()){
                      libDisplayFlag = true;
                  }
  </code></pre>
  
  <p>error log </p>
  
  <pre><code> 03-13 08:01:58.273: ERROR/AndroidRuntime(6188): Uncaught handler: thread main exiting due to uncaught exception
      03-13 08:01:58.292: ERROR/AndroidRuntime(6188): java.lang.NullPointerException
      03-13 08:01:58.292: ERROR/AndroidRuntime(6188):     at com.isproj3.NewActivity$3.onClick(NewActivity.java:158)
      03-13 08:01:58.292: ERROR/AndroidRuntime(6188):     at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:158)
      03-13 08:01:58.292: ERROR/AndroidRuntime(6188):     at android.os.Handler.dispatchMessage(Handler.java:99)
  </code></pre>
  
  <p>xml </p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical" android:layout_width="fill_parent"
      android:layout_height="fill_parent"&gt;
      &lt;LinearLayout android:orientation="horizontal"
          android:gravity="center" android:layout_width="fill_parent"
          android:layout_height="fill_parent" android:layout_weight="1"&gt;
          &lt;CheckBox android:id="@+id/checkboxlib" android:layout_width="wrap_content"
              android:layout_height="wrap_content" android:text="Library"
              android:gravity="left" android:textColor="#FF0000"
              android:paddingBottom="5px" android:textSize="07pt" android:checked="true" /&gt;
          &lt;TextView android:id="@+id/librarytext" android:layout_width="wrap_content"
              android:layout_height="wrap_content" android:gravity="center"
              android:paddingBottom="5px" android:textSize="8pt" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>