1

I have a ListView with a custom adapter. I can click on the list elements. However, it only works when clicking outside of the text area of the row. When clicking on the text nothing happens.

I have set the Row layout as:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="5dp"
    android:descendantFocusability="blocksDescendants">

....

And the text style includes:

<item name="android:clickable">false</item>
<item name="android:focusable">false</item>
<item name="android:focusableInTouchMode">false</item>

Do you have a solution where I will be able to click anywhere in the row?

7heViking
  • 7,137
  • 11
  • 50
  • 94

1 Answers1

1

change android:clickable to true in your text style

<item name="android:clickable">true</item>
nobalG
  • 4,544
  • 3
  • 34
  • 72
  • What if it is inside of a HorizontalScrollView? – 7heViking Jul 17 '14 at 12:53
  • try it,and update here if it is making any difference – nobalG Jul 17 '14 at 12:55
  • It doesn't work. The click event goes though on anyclick as long as the click is outside of the horizontalscrollview. I also tried adding focusable = false and clickable = true to the horizontalscrollview with no effect. – 7heViking Jul 17 '14 at 12:57
  • see if this helps http://stackoverflow.com/questions/16299145/textview-is-not-clickable-inside-scrollview-in-listview – nobalG Jul 17 '14 at 13:02