Android : Nullpointer issue
<p>My Nullpointer expection has me stumped. I am getting nullpointer exception at FindViewByID. Here is my piece of code</p>

<pre><code>public class numberActivity extends Activity {

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.number);

}    

ImageView portrait = (ImageView) findViewById(R.id.numberImage);
public void numberClick(View v) {   
    switch(v.getId()){
            case R.drawable.numberone:
                portrait.setImageResource(R.drawable.numbertwo);
                break;

            case R.drawable.numbertwo:
                portrait.setImageResource(R.drawable.numberthree);
                break;

        }

}
</code></pre>

<p>}</p>

<p>My number.xml is here</p>

<pre><code>&lt;ImageView
    android:id="@+id/numberImage"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/numberone" 
    android:onClick="numberClick" /&gt;
</code></pre>

<p>Very simple code i think, but the null pointer exception is frustrating me since last night. Any help is appreciated.</p>
