title: How to create a clickable Listview and go to new page
body: <p>I'm a new programmer in android. I want to create a Clickable Listview. I mean when users clicked on one item it goes to a new page and start a new activity. Please help me. 
  Thanks in advance.
  It's my code in mainactivity.java.</p>
  
  <pre><code>package first.app;
  
  import java.util.List;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.app.ListActivity;
  import android.content.Context;
  import android.content.Intent;
  import android.view.LayoutInflater;
  import android.view.Menu;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.view.ViewGroup;
  import android.webkit.WebView.FindListener;
  import android.widget.AdapterView;
  import android.widget.AdapterViewFlipper;
  import android.widget.ArrayAdapter;
  import android.widget.Button;
  import android.widget.ImageView;
  import android.widget.ListView;
  import android.widget.TextView;
  
  public class MainActivity extends ListActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      setListAdapter(new MyAdapter(this,
      android.R.layout.simple_list_item_1,R.id.textView1, 
      getResources().getStringArray(R.array.games)));
  
  }
  
  private class MyAdapter extends ArrayAdapter&lt;String&gt;{
  
      public MyAdapter(Context context, int resource, int textViewResourceId,
              String[] strings) {
          super(context, resource, textViewResourceId, strings);
  
      }
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
  
          LayoutInflater inflater = (LayoutInflater)        getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          View row = inflater.inflate(R.layout.list,parent, false);
          String[] items = getResources().getStringArray(R.array.games);
  
          ImageView iv = (ImageView) row.findViewById(R.id.imageView1);
          TextView tv = (TextView) row.findViewById(R.id.textView1);
  
          tv.setText(items[position]);
  
          if (items[position].equals("فوتبال")){
              iv.setImageResource(R.drawable.football);
          }
          else if (items[position].equals("شنا")){
              iv.setImageResource(R.drawable.swimming);
          }
          else if (items[position].equals("شمشیربازی")){
              iv.setImageResource(R.drawable.fencing);
          }
          else if (items[position].equals("شطرنج")){
              iv.setImageResource(R.drawable.chess);
          }       
          return row;
      }
  
  
      }
  
  
  }
  </code></pre>