Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List View with groups in android

Tags:

android

I have a list view with some date and text in each row.Can I group this listView into groups as in iPhone with header between them.Is it possible in android. Please help. i.e I need to have header bar between the Listview rows so that rows below each header will become a group if I am grouping it using date.

like image 987
James Avatar asked Oct 31 '11 08:10

James


People also ask

What is the list view in Android?

A list view is an adapter view that does not know the details, such as type and contents, of the views it contains. Instead list view requests views on demand from a ListAdapter as needed, such as to display new views as the user scrolls up or down. In order to display items in the list, call setAdapter(android.

How do you show data in a list view?

ListView listView = (ListView) findViewById(R. id. listview); listView. setAdapter(adapter);

Is ListView deprecated Android?

Conclusion. While the ListView is still a very capable view, for new projects, I'll strongly advise you use RecyclerView, and consider the ListView as deprecated. I can't think of any situation where the ListView is better than the RecyclerView, even if you implement your ListView with the ViewHolder pattern.


1 Answers

Here are the plenty of articles for Android - ListView with Section from Google, from that i have listed out some of important articles/tutorials:

  1. http://code.google.com/p/android-amazing-listview/
  2. http://android.amberfog.com/?p=296
  3. Creating categories in a ListView?
  4. Android ListView Headers
like image 86
Paresh Mayani Avatar answered Oct 29 '22 16:10

Paresh Mayani