can we have ListView inside ExpandableListView so that I can have group level first and then array of child (listView). i already finish from listview classes and it works perfectly! but how to call each group in expandable list view to display list view (layout)! and get the correct child ! please can any one help ! thanks.
-
Put listview in layout what You use for row of ExpandableListView – Rodion Altshuler Mar 05 '13 at 21:40
-
can i get more explanation ? thanks – jory Mar 06 '13 at 01:59
3 Answers
Actually you can put a scrollable view (e.g. your ListView) inside another scrollable view (e.g. your ExpandableListView) and make the former scrollable in the following way:
listView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
// disallow the onTouch for your scrollable parent view
v.getParent().requestDisallowInterceptTouchEvent(true);
return false;
}
});

- 373
- 5
- 17
Yes you can! But the real thing is to create a listView in a expandableView. Here is the trick: https://www.captechconsulting.com/blogs/android-expandablelistview-magic
-
1Should be https://www.captechconsulting.com/blogs/android-expandablelistview-magic – Kristy Welsh Jul 30 '16 at 13:07
Please take a look at this question which was asked two days ago. The user there was trying to put a custom view, derived from ListView into ExpandableListView. My answer to that question applies to your case as well, so I'll quote it:
You can't do that because you can't put a scrollable view(ListView) into another scrollable view(ExpandableListView). The reason is that the parent will consume all the touch events and they will never reach the child. ExpandableListView will scroll, but the ListView will never know that scrolling took place.

- 1
- 1

- 5,719
- 6
- 43
- 80