I had uses the MergeAdapter with this code: public void retrieveVideotheek() { try { HashMap<String, Object> response = (HashMap<String, Object>) client.call("film.retrieveTv", sessionKey);
Iterator it = response.entrySet().iterator(); while (it.hasNext()) { cinema = new ArrayList<FilmDetail>(); Map.Entry pairs = (Map.Entry)it.next(); Object[] cinemaFilms = (Object[])pairs.getValue(); FilmDetail cinemaMovie = new FilmDetail(); for (int i=0; i<cinemaFilms.length; i++) { cinemaMovie = new FilmDetail(); Map m = (Map) cinemaFilms[i]; cinemaMovie.setTitle(m.get("title").toString()); ..... cinema.add(cinemaMovie); } String datum = pairs.getKey().toString(); long unixTime = Long.parseLong(datum); long timeStamp = unixTime * 1000; java.util.Date date = new Date(timeStamp); SimpleDateFormat formatter = new SimpleDateFormat("EEEEEE, HH:mm 'uur'"); String parsed = formatter.format(date); System.out.println("DATUM: " + parsed); LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View filmLayout = inflater.inflate(R.layout.list_header, null); TextView headerTxt = (TextView)filmLayout.findViewById (R.id.list_header_title); headerTxt.setText(parsed); mergeAdapter.addView(headerTxt); mergeAdapter.addAdapter(new cinemaAdapter(this, R.layout.cinema_row, cinema)); //adapter.addSection(parsed, new cinemaAdapter(this, R.layout.cinema_row, cinema)); } and this is the response: {1255207800=[Ljava.lang.Object;@43780378, 1255199100= [Ljava.lang.Object;@43824bb8, 1255204800=[Ljava.lang.Object;@4381fd38, 1255212600=[Ljava.lang.Object;@43822ff0, 1255169700= [Ljava.lang.Object;@438289d8, 1255194000=[Ljava.lang.Object;@43796e08, 1255189800=[Ljava.lang.Object;@43819d98, 1255197600= [Ljava.lang.Object;@43824b18, 1255183500=[Ljava.lang.Object;@438147b8, 1255181400=[Ljava.lang.Object;@43859b58, 1255206000= [Ljava.lang.Object;@438189e0, 1255207500=[Ljava.lang.Object;@43790030, 1255212000=[Ljava.lang.Object;@43788908, 1255216500= [Ljava.lang.Object;@43823570} So for every key i make a new header with the corresponding Movies under this header. When the listActivity loads it shows it very well but when i scroll down and up it shows me this list like this: http://snapplr.com/stkn What is the problem? Wouter On Oct 10, 2:54 pm, Wouter <wouterg...@gmail.com> wrote: > Hey Mark, > > Yes I am using the SeperatedListAdapter from Jeff Sharkey, but I will > take a look at your SectionedAdapter. > Can I use it in my project? > > Wouter > > On Oct 10, 2:42 pm, Mark Murphy <mmur...@commonsware.com> wrote: > > > Wouter wrote: > > > What is the easiest way to add headers to a listview (and my list has > > > multiple adapters (sections) so I need to show multiple headers for my > > > list! > > > I have a MergeAdapter here that can serve that role: > > >http://github.com/commonsguy/cwac-merge > > > I have a SectionedAdapter here that can serve that role, but it is GPLv3 > > rather than Apache License 2.0: > > >http://github.com/commonsguy/cw-advandroid/tree/master/ListView/Secti... > > > The reason that is GPLv3 is because it is derived from Jeff Sharkey's > > original sectioned list code: > > >http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-... > > > -- > > Mark Murphy (a Commons > > Guy)http://commonsware.com|http://twitter.com/commonsguy > > > Need Android talent? Ask on HADO!http://wiki.andmob.org/hado --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---