title: How to listen to each button in ListView in Android
body: <p>I'm new to Android. I have a ListActivity that include a ListView. The item in ListView is customized. The xml layout is </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;TextView
          android:id="@+id/item"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:paddingLeft="5dp"
          android:paddingTop="5dp"
          android:textSize="22sp" &gt;&lt;/TextView&gt;
  
      &lt;TextView 
          android:id="@+id/item2" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:paddingBottom="10dp" 
          android:paddingLeft="10dp" 
          android:paddingTop="5dp" /&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:gravity="right" &gt;
  
          &lt;ImageButton
              android:id="@+id/imageButton1"
              android:layout_width="40dp"
              android:layout_height="40dp"
              android:background="@null"
              android:onClick="favoriteOnClick"
              android:src="@drawable/favorite_logo" /&gt;
  
  
      &lt;/RelativeLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>That have a ImageButton.<br>
  When the button was click. I want to retrieve which button was click(mean I need to retrieve which item of ListView).  </p>