package com.MyWeb; // change this to your package import android.app.Activity; import android.os.Bundle; import android.webkit.*; import android.view.*; import android.widget.*; import java.util.*; import android.util.Log; public class MyWeb extends Activity implements View.OnFocusChangeListener{ WebView webView; EditText editURL; String webSite; ArrayList webSiteList; int webSitePos; Button clearButton; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); webView = ???; // get the address of the WebView object webView.getSettings().setJavaScriptEnabled(true); editURL = ???; // get the address of the EditText object editURL.setOnFocusChangeListener(this); webView.loadUrl("http://www.autowaredevelopment.com/"); clearButton = ???; // get the address of the Button object webSite = "http://www.autowaredevelopment.com/"; editURL.setText(webSite); webSiteList = new ArrayList(); webSiteList.add(webSite); webSitePos = 0; webView.getSettings().setSupportZoom(true); webView.getSettings().setBuiltInZoomControls(true); } public void buttonOnClick(View view) { String webSite = editURL.getText().toString(); webSite = webSite.trim(); if (webSite.equals("")) return; if (webSite.equals("http://www.")) return; if (webSite.indexOf(".")<0) return; if (webSite.indexOf("http://")<0) webSite = "http://" + webSite; this.webSite = webSite; // load the url and save it in the webSiteList } public void onFocusChange(View view, boolean isFocused) { // nothing to do } public void refreshOnClick(View view) { // refresh the web page } public void backOnClick(View view) { if (webView.canGoBack()) { // go back a page and update the url in the EditText field } } public void clearOnClick(View view) { // clear the url } }