3

I am working in android. I want to show a list of events. I can make this list using listView.

But i want to add Day just before the list of events. Means i have two arrayList

  1. for Name of days
  2. for name of events for a day

So please suggest me how can i implement this.? you can provide me link related this topic or give a code help.

I need like this :--- enter image description here

Thank you in advance.

Pushpendra Kuntal
  • 6,118
  • 20
  • 69
  • 119
  • 1
    I would have a look at the suggestions below some of the earlier similar questions, like [this one](http://stackoverflow.com/questions/4545315/how-to-create-listview-with-categories-segments) and [this one](http://stackoverflow.com/questions/3962656/android-listview-groups). – MH. Nov 07 '11 at 06:00

2 Answers2

2

You can either use Sectioned ListView(You have to customize ListView) or Expandable ListView(inbuilt).

Sectioned ListView examples:

Expandable ListView examples:

Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
1

You can use a SimpleAdapter and bind the Name of the days to one TextView and the event name to another TextView. Your xml layout will then just be a LinearLayout, oriented horizontally, with two TextViews in it. Here's an example.

Kurtis Nusbaum
  • 30,445
  • 13
  • 78
  • 102