Android RelativeLayout.addView() exception when adding TextView
<p>I got an exception (<code>null pointer</code>) when I call the method addView() on my relative layout to add the textView</p>

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

    private final String TAG = FormAddNewTaskActivity.class.getCanonicalName();

    private TaskLiteApplication taskLiteApplication;

    /* (non-Javadoc)
     * @see android.app.Activity#onCreate(android.os.Bundle)
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.form_add_task);

        RelativeLayout rl = (RelativeLayout) findViewById(R.layout.form_add_task);
        TextView tv = new TextView(taskLiteApplication);
        tv.setText("blah blah");
        tv.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
        rl.addView(tv); //null pointer exeption there

        //set application context
        taskLiteApplication = ((TaskLiteApplication)getApplicationContext());

        //Spinner set list user
        Spinner s = (Spinner) this.findViewById(R.id.spinnerUser);

        //set list user
        ArrayList&lt;User&gt; listUser = taskLiteApplication.getCtrlUser().getListUserFromDataBase();

        //adapter user
        UserSpinnerAdapter userSpinnerAdapter = new UserSpinnerAdapter(listUser , getApplicationContext());

        //set adapter on the spinner
        s.setAdapter(userSpinnerAdapter);



        //set listener on add button task
        ImageButton imageButtonAdd = (ImageButton) findViewById(R.id.imageButtonAdd);
        imageButtonAdd.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.d(TAG, "add form new subtask");
            }
        });


    }

}
</code></pre>

<p>My XML:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#fff" &gt;

    &lt;RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" &gt;

        &lt;EditText
            android:id="@+id/editTextGroupTaskName"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:hint="@string/hint_task_name"
            &gt;

            &lt;requestFocus /&gt;
        &lt;/EditText&gt;

         &lt;Spinner
            android:id="@+id/spinnerUser"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/textViewDateDue"
            android:layout_below="@+id/editTextGroupTaskName" /&gt;      

        &lt;TextView
            android:id="@+id/textViewDateDue"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/spinnerUser"
            android:text="@string/date_due"
            android:textColor="#000"
            android:textAppearance="?android:attr/textAppearanceMedium" /&gt;

        &lt;DatePicker
            android:id="@+id/datePickerDateDue"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/textViewDateDue" /&gt;

        &lt;TextView 
            android:id="@+id/textViewSubTask"
            android:layout_below="@id/datePickerDateDue"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/sub_task"
            android:textColor="#000"
            android:paddingTop="11dp"
            android:paddingBottom="11dp"
            android:textAppearance="?android:attr/textAppearanceMedium"
            /&gt;

        &lt;ImageButton
            android:id="@+id/imageButtonAdd"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_below="@id/datePickerDateDue"
            android:src="@drawable/add" /&gt;

    &lt;/RelativeLayout&gt;


&lt;/ScrollView&gt;
</code></pre>

<p>Log Cat :</p>

<pre><code> 07-17 14:07:40.696: D/AndroidRuntime(338): Shutting down VM
...
07-17 14:07:40.707: E/AndroidRuntime(338): Caused by: java.lang.NullPointerException
07-17 14:07:40.707: E/AndroidRuntime(338):  at android.view.View.&lt;init&gt;(View.java:1823)
07-17 14:07:40.707: E/AndroidRuntime(338):  at android.widget.TextView.&lt;init&gt;(TextView.java:326)
07-17 14:07:40.707: E/AndroidRuntime(338):  at android.widget.TextView.&lt;init&gt;(TextView.java:320)
07-17 14:07:40.707: E/AndroidRuntime(338):  at android.widget.TextView.&lt;init&gt;(TextView.java:315)
07-17 14:07:40.707: E/AndroidRuntime(338):  at activity.FormAddNewTaskActivity.onCreate(FormAddNewTaskActivity.java:38)
07-17 14:07:40.707: E/AndroidRuntime(338):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
</code></pre>
