Creating Android WebView programmatically

MainActivity.java

package com.mycompany.myapp;

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

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

		final WebView myWeb = new WebView(this);
		myWeb.getSettings().setSupportZoom(true);
		myWeb.getSettings().setJavaScriptEnabled(true);
		myWeb.getSettings().setBuiltInZoomControls(true);

	    String myHtml = "<html><body><h2>Hello World</h2><hr>Welcome to Sytech<hr></body></html>";
		myWeb.loadData(myHtml, "text/html", "UTF-8");

		myLayout.addView(myWeb);

		setContentView(myLayout);
	}
}