title: Unable to start activity ComponentInfo caused by NullPointerException
body: <p>When I run this code:</p>
  
  <pre><code>    package com.herring.android.finalproject;
  
  
      import android.app.ListActivity;
      import android.content.Intent;
      import android.database.Cursor;
      import android.os.Bundle;
      import android.view.View;
      import android.widget.ListView;
      import android.widget.SimpleCursorAdapter;
      public class GamesListActivity extends ListActivity {
          private Cursor gamesCursor;
          private GameDataBaseManager mDbHelper;
          public void onCreate(Bundle savedInstanceState)
          {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.toprated);
              mDbHelper = new GameDataBaseManager(this);
              mDbHelper.open();
              fillData();
              registerForContextMenu(getListView());
              final ListView lv = (ListView) findViewById(R.id.text1);
              lv.setOnClickListener(new View.OnClickListener(){
                  public void onClick(View v)
                  {
                      Intent i = new Intent(GamesListActivity.this, Game.class);
                      startActivityForResult(i, 0);
                  }
              });
  
          }
          private void fillData()
          {
              gamesCursor = mDbHelper.getAllGames();
              startManagingCursor(gamesCursor);
              String[] from = new String[]{GameDataBaseManager.KEY_TITLE};
              int[] to = new int[]{R.id.text1};
              SimpleCursorAdapter games = new SimpleCursorAdapter(this, R.layout.toprateditem, gamesCursor, from, to);
              setListAdapter(games);
          }
      }
  </code></pre>
  
  <p>I get this in Logcat:</p>
  
  <pre><code>01-18 17:46:08.742: ERROR/AndroidRuntime(1382): Uncaught handler: thread main exiting due to uncaught exception
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.herring.android.finalproject/com.herring.android.finalproject.GamesListActivity}: java.lang.NullPointerException
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at android.os.Handler.dispatchMessage(Handler.java:99)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at android.os.Looper.loop(Looper.java:123)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at android.app.ActivityThread.main(ActivityThread.java:4363)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at java.lang.reflect.Method.invokeNative(Native Method)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at java.lang.reflect.Method.invoke(Method.java:521)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at dalvik.system.NativeStart.main(Native Method)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382): Caused by: java.lang.NullPointerException
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at com.herring.android.finalproject.GamesListActivity.onCreate(GamesListActivity.java:23)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
  01-18 17:46:08.752: ERROR/AndroidRuntime(1382):     ... 11 more
  </code></pre>
  
  <p>The error occurs at lv.setOnClickListener
  I have searched everywhere for an answer, but they all seem to talk about missing setContentView, which I am not.  I am totally lost.  Any help would be greatly appreciated.</p>
  
  <p>EDIT: Here is my toprated.xml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
      &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;ListView 
          android:id="@android:id/list"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          /&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>