I have a ListView with a custom Adapter which populates Items with an EditText and a TextView:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/et_choice_prob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="numberSigned"/>
<TextView
android:id="@+id/tv_choice_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/et_choice_prob"
android:layout_alignBaseline="@id/et_choice_prob"
android:layout_marginLeft="5dip"
/>
</RelativeLayout>
If I want to set an OnItemClickListener
it gets never called, due to the EditText stealing the focus.
Another thread mentioned that I should set focusable
to false
, which will remove the ability to actually edit the TextView.
I have also tried to set descendantFocusability
of the ListView
to any available option withot success.
The Adapter is doing nothing fancy, but I'll provide source on request. Everything else is done in the same way on another ListFragment
and works.