Could not find a TextView by calling findViewById method
<p>I cannot find a TextView by calling findViewById method even through the ID does exists.
please see my code:</p>

<p>Activity:</p>

<pre><code>public class OtherActivity extends Activity { 
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        TextView textView = (TextView)findViewById(R.ID.txt02);
        super.onCreate(savedInstanceState);//line 5
        setContentView(R.layout.other_activity);
        //textView.setText(ACCESSIBILITY_SERVICE);
        Button button = (Button)findViewById(R.ID.otherActivity_Btn);
        button.setText(R.string.otherActivityBtn);
        button.setOnClickListener(new GoBackBtnListener(this));
    }

    class GoBackBtnListener implements OnClickListener {
        OtherActivity other = null;
        public GoBackBtnListener(OtherActivity p_other) {
            other = p_other;
        }
        public void onClick(View v) {
            Intent intent = new Intent();
            intent.setClass(other, Activity01Activity.class);
            other.startActivity(intent);
        }
    }
}
</code></pre>

<p>I add a breakpoint at line 5 and start project in debug mode, when the executing stopped at the break point, I moved the mouse to variable textView, it is null.
the other_activity.xml is like this:</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;TextView 
    android:id="@+ID/txt02"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
/&gt;

&lt;Button 
    android:id="@+ID/otherActivity_Btn"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
/&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>and the Androidmenifest.xml is like this:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.hp" android:versionCode="1" android:versionName="1.0"&gt;
    &lt;uses-sdk android:minSdkVersion="4" /&gt;

    &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
        &lt;activity android:name=".Activity01Activity" android:label="@string/app_name"&gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;
                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
        &lt;activity android:name=".OtherActivity" android:label="@string/other"&gt;&lt;/activity&gt;
    &lt;/application&gt;
&lt;/manifest&gt;
</code></pre>

<p>the R.java is as below:</p>

<pre><code>public final class R {
    public static final class ID {
        public static final int Activity01_btn=0x7f050001;
        public static final int otherActivity_Btn=0x7f050003;
        public static final int txt01=0x7f050000;
        public static final int txt02=0x7f050002;
    }
    public static final class attr {
    }
    public static final class drawable {
        public static final int icon=0x7f020000;
    }
    public static final class layout {
        public static final int main=0x7f030000;
        public static final int other_activity=0x7f030001;
    }
    public static final class string {
        public static final int app_name=0x7f040001;
        public static final int hello=0x7f040000;
        public static final int other=0x7f040002;
        public static final int otherActivityBtn=0x7f040003;
    }
}
</code></pre>

<p>So, I don't think the TextView could not be found, but why the variable textView is null. I was confused.
could you please help me to find the root cause?</p>
