Creating Android ListView programmatically

MainActivity.java

package com.mycompany.myapp;

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

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

		TextView myText1 = new TextView(MainActivity.this);
		myText1.setText("Here is my List:");
		myText1.setTextSize(23);
		
		final ListView myListView = new ListView(MainActivity.this);

		String[] dataList1 = {
			"List item one", 
			"List item two",
			"List item three",
			"List item four"
			};
			
		ArrayAdapter<String> listviewAdpt = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, dataList1);

		myListView.setAdapter(listviewAdpt);

		myLinear1.addView(myText1);
		myLinear1.addView(myListView);

		setContentView(myLinear1);
	}
}