I have a listview that is dynamically populated with CheckedTextViews. The listview is set to multiple choice mode. I'm using OnItemClickListener to respond to clicks on my listview. Also I made an XML file with CheckedTextView's layout (actually it is just a copy of standard android.R.layout.simple_list_item_multiple_choice). So in this case all works fine: when I'm clicking an item in the listview, the appropriate checkedtextview becomes checked. But when I'm trying to use the following layout, the checkedtextview doesn't respond to the click and still unchecked.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical"
android:padding="5px">
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:drawableLeft="@drawable/checkbox_selector"
android:paddingLeft="6dip"
android:paddingRight="6dip"
android:background="#00ffffff"
android:textSize="15sp"
android:singleLine="true"/>
</LinearLayout>
I guess that it because CheckedTextViews are put into LinearLayout and they don't receive the click event from list items of the Listview.