views:

218

answers:

2

Hi everyone,

I've been implementing a number of custom-lists, all worked fine. Now I'm trying to add an EditText to the list's rows. The rows look like that:

<?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">

    <TextView android:id="@+id/tv_quest_listrow_categorical_text"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:text="blabla"
        android:paddingLeft="10dp"
        android:minHeight="48dp"
        android:gravity="center_vertical" />
    <EditText android:id="@+id/tv_quest_listrow_text"
        android:layout_width="60dp"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:layout_marginRight="10dp"
        android:gravity="right|center_vertical"
        android:singleLine="true"
        android:enabled="false"
        android:imeOptions="actionDone" />

</RelativeLayout>

When constructing the list I set an ItemClickListener for the list with listView.setOnItemClickListener(onItemClick);. This used to work fine but fails as soon as there is an EditText in the list rows.

Does anyone have a hint on how to do this?

Regards,
Steff

+1  A: 

I found this page, which has some good information on it. Apparently others have had this issue as well.

YGL
Thanks, that answers my question. It's a shame, nonetheless...
steff
did you see code at the bottom? not sure if that would work in your case.
YGL
another related post: http://stackoverflow.com/questions/1518338/setonitemclicklistener-not-working-on-custom-listview-android
YGL
thanks, I found a workaround
steff
A: 

Hi

Try iterating through the items of the ListView and set the OnItemClick listner individually for each item

thanks

Mina Samy