title: Android - how to add an item click method to an ArrayAdapter
body: <p>I have a simple ArrayAdapter. I want to set up a listener for every row click of my list such that a new Activity opens. How would I do that? My ArrayAdapter code -</p>
  
  <pre><code>public class CountryListAdapter extends ArrayAdapter&lt;String&gt; {
  private final Activity context;
  private final ArrayList&lt;String&gt; names;
  
  public CountryListAdapter(Activity context, ArrayList&lt;String&gt; names) {
      super(context, R.layout.rowlayout, names);
      this.context = context;
      this.names = names;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      LayoutInflater inflater = context.getLayoutInflater();
      View rowView = inflater.inflate(R.layout.rowlayout, null, true);
      TextView textView = (TextView) rowView.findViewById(R.id.label);
      textView.setText(names.get(position));
      return rowView;
  }
  </code></pre>