I have a pretty complicated ListView . Each item looks something like this:
> LinearLayout (vertical) > LinearLayout (horizontal) > include (horizontal LinearLayout with two TextViews) > include (ditto) > include (ditto) > TextView > HorizontalScrollView (this guy is my problem) > LinearLayout (horizontal)
In my activity, when an element is created ( getView() is called), I add a dynamic TextView to the LinearLayout inside the HorizontalScrollView (in addition to filling in another, simpler material). Surprisingly, the performance is very good.
My problem is that when I added HorizontalScrollView , my list items became unattractive. They do not get an orange background when clicked, and they do not start the OnItemClickedListener , which I set (to make a simple call to Log.d ).
How can I add list items again?
Edit: android:descendantFocusability="blocksDescendants" setting android:descendantFocusability="blocksDescendants" at the top of LinearLayout works. I would like to know if there are other ways: what if I want the objects to focus in my list items?
android listview
Felix
source share