title: Android: setting onListItemClick for a custom row
body: <p>thanks for reading this and helping I appreciate it!
  In one of my android activities I have a custom list and it works great, this is the xml for it</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="horizontal" 
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"&gt;
  
   &lt;ImageView android:id="@+id/imgIcon"
      android:layout_width="wrap_content"
      android:layout_height="fill_parent"
      android:gravity="center_vertical"
      android:layout_alignParentTop="true"
      android:layout_alignParentBottom="true"
      android:layout_marginRight="15dp"/&gt;
  
   &lt;TextView android:id="@+id/txtTitle"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:gravity="center_vertical"
      android:layout_alignParentTop="true"
      android:layout_alignParentBottom="true"
      android:textStyle="bold"
      android:textSize="18dp"
      android:textColor="#000000"
      android:layout_marginTop="5dp"
      android:layout_marginBottom="5dp" /&gt;
  
    &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I use it in my activity like this</p>
  
  <pre><code>MemberListObjectAdapter adapter = new MemberListObjectAdapter(Brothers.this, 
                              R.layout.listview_item_row,   memberListObject_data);
  
                      listView1.setAdapter(adapter);
  </code></pre>
  
  <p>and this is my Adapter class</p>
  
  <pre><code>public class MemberListObjectAdapter extends ArrayAdapter&lt;MemberListObject&gt;{
  
  Context context; 
  int layoutResourceId;    
  MemberListObject data[] = null;
  
  public MemberListObjectAdapter(Context context, int layoutResourceId, MemberListObject[] data) {
      super(context, layoutResourceId, data);
      this.layoutResourceId = layoutResourceId;
      this.context = context;
      this.data = data;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      View row = convertView;
      WeatherHolder holder = null;
  
      if(row == null)
      {
          LayoutInflater inflater = ((Activity)context).getLayoutInflater();
          row = inflater.inflate(layoutResourceId, parent, false);
  
          holder = new WeatherHolder();
          holder.imgIcon = (ImageView)row.findViewById(R.id.imgIcon);
          holder.txtTitle = (TextView)row.findViewById(R.id.txtTitle);
  
          row.setTag(holder);
      }
      else
      {
          holder = (WeatherHolder)row.getTag();
      }
  
      MemberListObject memberListObject = data[position];
      holder.txtTitle.setText(memberListObject.title);
      holder.imgIcon.setImageResource(memberListObject.icon);
  
      return row;
  }
  
  static class WeatherHolder
  {
      ImageView imgIcon;
      TextView txtTitle;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>in my activity I would like to have an onListItemClick method or something similar to this</p>
  
  <pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {
      // TODO Auto-generated method stub
      super.onListItemClick(l, v, position, id);
  
  }
  </code></pre>
  
  <p>so i would be able to click on my list items and do something with them, In previous activities the above method worked for me but i think because this is a custom list it is not working now. at the moment the line "super.onListItemClick(l,v,position,id);" the onListItemClick is underlined and it says "The method onListItemClick(ListView, View, int, long) is undefined for the type Activity". So my question is, How can I work with my code to make my list items clickable? Thank you! I really appreciate any help</p>