My app has several RelativeLayout
s with a TextView
and a ListView
in each. I've made the RelativeLayout
s clickable (and it works well). The problem is, the ListView
s that are embedded in them are also clickable, and whenever the user tries to click the area of the RelativeLayout
with the list, the click registers for the list instead.
I've tried setting the ListView
s as clickable="false"
and focusable="false"
. I've tried descendantsFocusability="blocksDescendants"
on the RelativeLayout
s. Those don't work.
What's the solution? This is my first app, am I missing something?
I solved my problem by making the lists' items' onItemClick methods mimic the onClick method of their parent RelativeLayout.
If the parent RelativeLayout would lead to fragmentA, then each item in its child list also leads to fragmentA.
This feels a bit half-baked and cheap, but it works for now.