I have a ListView
that inflate for each row a xml that contain a CheckBox
and more TextView
s that are in a RelativeLayout
.
The problem is that I can't figure out how to pass onClick events from checkbox to back row.
I want to achieve this behavior: The user press the checkbox and the whole list row gets pressed. I saw this behavior if I inflate for each row android.R.layout.simple_list_item_multiple_choice
but I can't figure out how to do that without this android specific layout.
Can anybody give me an idea or direction?
Below is the code:
Listview :
<ListView
android:id="@+id/include_sent_list_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white"
android:cacheColorHint="@color/white"
android:layout_alignParentTop="true"/>
And the xml that is inflated for each row:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<CheckBox
android:id="@+id/checked_radio_button"
android:layout_width="50dp"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:focusable="false"
/>
<TextView
android:id="@+id/account_number_text"
android:layout_width="100dp"
android:layout_height="fill_parent"
style="@style/config_simple_small_text_view_style"
android:paddingTop="15dp"
android:layout_toRightOf="@id/checked_radio_button"
/>
<TextView
android:id="@+id/account_name_text"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
style="@style/config_simple_small_text_view_style"
android:paddingTop="15dp"
android:layout_toRightOf="@id/account_number_text"/>
</RelativeLayout>