Null Pointer Exception in setting a value to TextView
<pre><code>TextView t =(TextView)findViewById(R.id.place); 
t.setText("A");
</code></pre>

<p>i call the above code inside <code>onCreate()</code> method. My activity is a ListActivity. But why this gives me the following error</p>

<pre><code>05-04 14:21:40.840: E/AndroidRuntime(16168): Caused by: java.lang.NullPointerException
</code></pre>

<p>and here is the XML where i defined TextView</p>

<pre><code>&lt;TextView android:id="@+id/place"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:textSize="16sp"
            android:textStyle="bold" 
            android:focusable="false"
            android:text=""
            android:layout_gravity="left"/&gt;
</code></pre>

<p>and how to fix it?</p>
