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