title: NullPointerException when adding a row in a TableLayout
body: <pre><code>  TableLayout table = (TableLayout) findViewById(R.id.TableLayout1);
    TableRow row = new TableRow(this);
    TextView t = new TextView(this);
    t.setText(String.valueOf(day[i]));
    row.addView(t);
    table.addView(row,new TableLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
  </code></pre>
  
  <p>The last instruction is giving me the <code>"Unable to start activity component info: java.lang.NullPointerException"</code>. However the same code in a clean project with the same instructions isn't...</p>
  
  <p>The <code>table.xml</code> is:</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;TableLayout android:id="@+id/TableLayout1" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content"  
      android:stretchColumns="0"&gt;
  &lt;/TableLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>LOG:</p>
  
  <pre><code>04-27 14:19:27.267: E/AndroidRuntime(2503): FATAL EXCEPTION: main
  04-27 14:19:27.267: E/AndroidRuntime(2503): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.seapredictions/com.seapredictions.ShowData}: java.lang.NullPointerException
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at android.os.Handler.dispatchMessage(Handler.java:99)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at android.os.Looper.loop(Looper.java:137)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at android.app.ActivityThread.main(ActivityThread.java:4424)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at java.lang.reflect.Method.invokeNative(Native Method)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at java.lang.reflect.Method.invoke(Method.java:511)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at dalvik.system.NativeStart.main(Native Method)
  04-27 14:19:27.267: E/AndroidRuntime(2503): Caused by: java.lang.NullPointerException
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at com.seapredictions.ShowData.onCreate(ShowData.java:33)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at android.app.Activity.performCreate(Activity.java:4465)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
  04-27 14:19:27.267: E/AndroidRuntime(2503):     ... 11 more
  04-27 14:19:27.636: I/dalvikvm(2503): threadid=3: reacting to signal 3
  04-27 14:19:27.676: I/dalvikvm(2503): Wrote stack traces to '/data/anr/traces.txt'
  04-27 14:19:27.807: I/dalvikvm(2503): threadid=3: reacting to signal 3
  04-27 14:19:27.827: I/dalvikvm(2503): Wrote stack traces to '/data/anr/traces.txt'
  04-27 14:19:27.887: D/dalvikvm(2503): GC_CONCURRENT freed 230K, 4% free 9243K/9543K, paused 3ms+3ms
  </code></pre>