Skip to content Skip to sidebar Skip to footer

Best Native Component To Use For Separate Listview In Android

Hi I need to have a list view which is separated by date which native component i should use in android?can zou help me mazbe with some links, how to do it.I have an list activity

Solution 1:

You could use a normal ListView, you'd just have to put logic in your adapters getView() method that inflates a date View at the appropriate times.


Solution 2:

An ExpandableListView with custom group and child layout and disabled collapsing would be the simplest solution for you.

The list of groups would be the dates, the list of children would be the childLists (for each group a list).

But with a BaseExpandableListAdapter and a hierarchical data structure it would be even easier.
There you'd need a Day class with name (or date), and a list of Child instances, where Child has a title and a details member.

  • Child {title: String, details: String}
  • Day {date: Date, List<Child> children}

Post a Comment for "Best Native Component To Use For Separate Listview In Android"