Creating Android LinearLayout programmatically

MainActivity.java

package com.mycompany.myapp;

import android.app.*;
import android.graphics.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import android.text.*;

public class MainActivity extends Activity 
{
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
		
		LinearLayout myLinear1 = new LinearLayout(MainActivity.this);
		myLinear1.setOrientation(1);

		final TextView myText1 = new TextView(this);
		myText1.setText("I m in a LinearLayout that was created dynamically");
		
		myLinear1.addView(myText1);
		
		setContentView(myLinear1);
    }
}