How to create several kinds of list in android

How to create several types of lists in one action? Each ListView should have a dedicated title that allows you to expand or collapse your list, and scrolling on any ListView should scroll through all the activity (NOT one scroll for the first ListView , and the second for the second ListView ONLY one scroll for BOTH ListView ...)

listviews is dynamically populated ...

Here is a screenshot of a similar view:

enter image description here

0
source share
1 answer

What you are describing is an ExpandableListView

The easiest way to create this is to change the ListView in XML to an ExpandableListView and use one of the ExpandableListAdapter SimpleExpandableListAdapter or BaseExpandableListAdapter that work similar to their non-extensible versions.

Here is an example from the Android Samples API, which can be downloaded using the SDK manager.

+1
source

Source: https://habr.com/ru/post/953995/


All Articles