Creating Android Switch programmatically

MainActivity.java

package com.mycompany.myapp;

import android.app.*;
import android.os.*;
import android.widget.*;

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

		final Switch mySwitch = new Switch(this);
		mySwitch.setText("Click here ..");
		mySwitch.setTextSize(23);
		mySwitch.setChecked(false);

		myLinear.addView(mySwitch);
		
		setContentView(myLinear);
	}
}