I have created a basic ListView and added a TextView and ImageView in it.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30sp"
/>
<ImageView
android:id="@+id/icon"
android:layout_width="50px"
android:paddingLeft="2px"
android:paddingRight="2px"
android:paddingTop="2px"
android:layout_height="wrap_content"
android:layout_alignParentRight = "true"
android:src="@drawable/call"
/>
</RelativeLayout>
I need to make ImageView clickable so that if some clicks on it an action will happen, like a new activity is opened. Can someone help me how to do this?
Thanks