Re: [android-developers] Re: Listview - Header , footer issue

2012-10-11 Thread Jovish P
Thanks for the clarification. Wil give a try this.

Regards,
Jovish

On Wed, Oct 10, 2012 at 6:26 PM, Piren gpi...@gmail.com wrote:

 Maybe i delivered what i meant wrong...
 You can still inflate rows predefined using XML, but your the way to
 create the specific inner layout would have to be created manually.

 you want to do something like this:
 scrollview
linearlayout
   textview/
   listview/
   textview/
   listview/
/linearlayout
 /scrollview

 You can't do that in android (well, you can, it just wouldn't work as you
 expect it to).

 The best option is to just do:
 scrollview
linearlayout/
 /scrollview

 and then inflate all the information inside that linear layout.
 Practically making your entire page one ListView (a listview is exactly
 that.. a linear layout inside a scrollview with some fancy wrapper code to
 make your life easier)

 Your adapter would just have to know how to inflate the rows
 differently according to their type.
 i.e - the first row is just a regular textview (the header).
 the second to X row would be rows of the first listview you wanted.
 X+1 row is again a textview (the footer) and then X+2 to the end are rows
 of the second listview type.



 On Wednesday, October 10, 2012 7:25:20 AM UTC+2, Jovish P wrote:

 Sorry , we are not able to understand you fully. Wht is the difference
 between the first approach we explained in the mail and the approach u
 suggested .  Up to our knowledge both are same . Wht difference it is going
 to make if u inflate every view programmatically instead of using xml ?

 On Tue, Oct 9, 2012 at 3:25 PM, Piren gpi...@gmail.com wrote:

 Android doesn't support putting two scrollable views one inside the
 other and i assume you dont want to divide the screen area between the
 listviews and make each take a constant size.

 You're best (and probably only) choice is to just do everything
 manually. put a linear layout inside a scrollview and inflate everything in
 it manually. (the two textviews and the two listviews).
 you can actually use the same code you wrote for your listviews to do
 that with some modifications.
 It sounds like a lot of effort, but after doing it a few times i've
 noticed that it isnt. in some instances it even makes stuff easier.


 On Tuesday, October 9, 2012 9:15:42 AM UTC+2, Jovish P wrote:

 In one of screen  we want to come up with a desing like this

 Textview
 Listview
 Textview
 Listview

 First we thought of putting everything inside a linear layout with
 vertical orientation and put that layout inside
 a scroll view. Then we come to know that it is not a good idea. So
 right now what we are trying to do is
 add header and footer for listview. Header view will be a text view and
 footer view will be a layout which conatins
 a texview and listview. The problem what we are facing now is ,  we are
 not able to scroll the second listview which is in
 footerview layout. Is it a good solution ? If not wht is the best way
 to do this ? Share your thoughts about this.



  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@**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=enhttp://groups.google.com/group/android-developers?hl=en


  --
 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


-- 
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

Re: [android-developers] Re: Listview - Header , footer issue

2012-10-10 Thread Piren
Maybe i delivered what i meant wrong...
You can still inflate rows predefined using XML, but your the way to create 
the specific inner layout would have to be created manually.

you want to do something like this:
scrollview
   linearlayout
  textview/
  listview/
  textview/
  listview/
   /linearlayout
/scrollview

You can't do that in android (well, you can, it just wouldn't work as you 
expect it to).

The best option is to just do:
scrollview
   linearlayout/
/scrollview

and then inflate all the information inside that linear layout. 
Practically making your entire page one ListView (a listview is exactly 
that.. a linear layout inside a scrollview with some fancy wrapper code to 
make your life easier)

Your adapter would just have to know how to inflate the rows 
differently according to their type.
i.e - the first row is just a regular textview (the header).
the second to X row would be rows of the first listview you wanted.
X+1 row is again a textview (the footer) and then X+2 to the end are rows 
of the second listview type.



On Wednesday, October 10, 2012 7:25:20 AM UTC+2, Jovish P wrote:

 Sorry , we are not able to understand you fully. Wht is the difference 
 between the first approach we explained in the mail and the approach u 
 suggested .  Up to our knowledge both are same . Wht difference it is going 
 to make if u inflate every view programmatically instead of using xml ? 

 On Tue, Oct 9, 2012 at 3:25 PM, Piren gpi...@gmail.com javascript:wrote:

 Android doesn't support putting two scrollable views one inside the other 
 and i assume you dont want to divide the screen area between the listviews 
 and make each take a constant size.

 You're best (and probably only) choice is to just do everything manually. 
 put a linear layout inside a scrollview and inflate everything in it 
 manually. (the two textviews and the two listviews).
 you can actually use the same code you wrote for your listviews to do 
 that with some modifications.
 It sounds like a lot of effort, but after doing it a few times i've 
 noticed that it isnt. in some instances it even makes stuff easier.


 On Tuesday, October 9, 2012 9:15:42 AM UTC+2, Jovish P wrote:

 In one of screen  we want to come up with a desing like this

 Textview
 Listview
 Textview
 Listview

 First we thought of putting everything inside a linear layout with 
 vertical orientation and put that layout inside
 a scroll view. Then we come to know that it is not a good idea. So right 
 now what we are trying to do is
 add header and footer for listview. Header view will be a text view and 
 footer view will be a layout which conatins
 a texview and listview. The problem what we are facing now is ,  we are 
 not able to scroll the second listview which is in
 footerview layout. Is it a good solution ? If not wht is the best way to 
 do this ? Share your thoughts about this.



  -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to 
 android-d...@googlegroups.comjavascript:
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
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

[android-developers] Re: Listview - Header , footer issue

2012-10-09 Thread Piren
Android doesn't support putting two scrollable views one inside the other 
and i assume you dont want to divide the screen area between the listviews 
and make each take a constant size.

You're best (and probably only) choice is to just do everything manually. 
put a linear layout inside a scrollview and inflate everything in it 
manually. (the two textviews and the two listviews).
you can actually use the same code you wrote for your listviews to do that 
with some modifications.
It sounds like a lot of effort, but after doing it a few times i've noticed 
that it isnt. in some instances it even makes stuff easier.

On Tuesday, October 9, 2012 9:15:42 AM UTC+2, Jovish P wrote:

 In one of screen  we want to come up with a desing like this

 Textview
 Listview
 Textview
 Listview

 First we thought of putting everything inside a linear layout with 
 vertical orientation and put that layout inside
 a scroll view. Then we come to know that it is not a good idea. So right 
 now what we are trying to do is
 add header and footer for listview. Header view will be a text view and 
 footer view will be a layout which conatins
 a texview and listview. The problem what we are facing now is ,  we are 
 not able to scroll the second listview which is in
 footerview layout. Is it a good solution ? If not wht is the best way to 
 do this ? Share your thoughts about this.





-- 
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

Re: [android-developers] Re: Listview - Header , footer issue

2012-10-09 Thread Jovish P
Sorry , we are not able to understand you fully. Wht is the difference
between the first approach we explained in the mail and the approach u
suggested .  Up to our knowledge both are same . Wht difference it is going
to make if u inflate every view programmatically instead of using xml ?

On Tue, Oct 9, 2012 at 3:25 PM, Piren gpi...@gmail.com wrote:

 Android doesn't support putting two scrollable views one inside the other
 and i assume you dont want to divide the screen area between the listviews
 and make each take a constant size.

 You're best (and probably only) choice is to just do everything manually.
 put a linear layout inside a scrollview and inflate everything in it
 manually. (the two textviews and the two listviews).
 you can actually use the same code you wrote for your listviews to do that
 with some modifications.
 It sounds like a lot of effort, but after doing it a few times i've
 noticed that it isnt. in some instances it even makes stuff easier.


 On Tuesday, October 9, 2012 9:15:42 AM UTC+2, Jovish P wrote:

 In one of screen  we want to come up with a desing like this

 Textview
 Listview
 Textview
 Listview

 First we thought of putting everything inside a linear layout with
 vertical orientation and put that layout inside
 a scroll view. Then we come to know that it is not a good idea. So right
 now what we are trying to do is
 add header and footer for listview. Header view will be a text view and
 footer view will be a layout which conatins
 a texview and listview. The problem what we are facing now is ,  we are
 not able to scroll the second listview which is in
 footerview layout. Is it a good solution ? If not wht is the best way to
 do this ? Share your thoughts about this.



  --
 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

-- 
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

[android-developers] Re: ListView header/footer problem

2012-03-22 Thread Jason Tian
I've had a similar problem. And here is my solution:

Put the header/footer in another wrapper layout (e.g. a FrameLayout maybe), 
and set this wrapper to be the header/footer.

Hope it works.

在 2012年3月19日星期一UTC+8下午2时56分31秒,gropapa写道:

 hello guys,
 I have an expandableListView in wich i add a LinearLayout View as header 
 and another one for the footer.
 After i affect the Adapter, i want to be able to show/hide those views.
 The problem is that if i write
 myView.setVisibility(View.GONE)
 it acts exactly the same as INVISIBLE.
 Since it is not possible to removeHeader and add it back... really don't 
 see how i can fix, if you have any idea


-- 
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

[android-developers] Re: listview header

2009-10-11 Thread Getto

Did you try addHeaderView method?

http://developer.android.com/reference/android/widget/ListView.html#addHeaderView(android.view.View)

.g

On Oct 10, 2:12 pm, Wouter wouterg...@gmail.com wrote:
 Hey,

 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!

 Thank you,

 Wouter
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: listview header

2009-10-11 Thread Wouter

When i use this method i have all my headers at the top of my list and
i want to show header - list -header- list..

On Oct 11, 11:47 am, Getto gige...@gmail.com wrote:
 Did you try addHeaderView method?

 http://developer.android.com/reference/android/widget/ListView.html#a...)

 .g

 On Oct 10, 2:12 pm, Wouter wouterg...@gmail.com wrote:

  Hey,

  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!

  Thank you,

  Wouter
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: listview header

2009-10-10 Thread Mark Murphy

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/Sections/

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-android-09/

-- 
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
-~--~~~~--~~--~--~---



[android-developers] Re: listview header

2009-10-10 Thread xii stan
TextViewListView
TextView
ListView

On Sat, Oct 10, 2009 at 8:42 PM, Mark Murphy mmur...@commonsware.comwrote:


 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/Sections/

 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-android-09/

 --
 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
-~--~~~~--~~--~--~---



[android-developers] Re: listview header

2009-10-10 Thread Wouter

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
-~--~~~~--~~--~--~---



[android-developers] Re: listview header

2009-10-10 Thread Wouter

I had uses the MergeAdapter with this code:

public void retrieveVideotheek()
{
try {
HashMapString, Object response = (HashMapString, 
Object)
client.call(film.retrieveTv, sessionKey);

Iterator it = response.entrySet().iterator();

while (it.hasNext()) {
cinema = new ArrayListFilmDetail();
Map.Entry pairs = (Map.Entry)it.next();
Object[] cinemaFilms = (Object[])pairs.getValue();
FilmDetail cinemaMovie = new FilmDetail();

for (int i=0; icinemaFilms.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(EE,
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
-~--~~~~--~~--~--~---



[android-developers] Re: listview header

2009-10-10 Thread Mark Murphy

Wouter wrote:
 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?

Sure! As I noted, SectionedAdapter is GPLv3, because it's derived from
Jeff's code, which itself is GPLv3.

If that license is incompatible with your goals, you can achieve the
same effect with MergeAdapter, which is Apache License 2.0 (same as
Android proper).

-- 
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
-~--~~~~--~~--~--~---



[android-developers] Re: listview header

2009-10-10 Thread Mark Murphy

Wouter wrote:
 I had uses the MergeAdapter with this code:
 
   public void retrieveVideotheek()
 {
   try {
   HashMapString, Object response = (HashMapString, 
 Object)
 client.call(film.retrieveTv, sessionKey);
 
   Iterator it = response.entrySet().iterator();
 
   while (it.hasNext()) {
   cinema = new ArrayListFilmDetail();
   Map.Entry pairs = (Map.Entry)it.next();
   Object[] cinemaFilms = (Object[])pairs.getValue();
   FilmDetail cinemaMovie = new FilmDetail();
 
   for (int i=0; icinemaFilms.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(EE,
 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?

Off the top of my head, I have no idea.

   mergeAdapter.addView(headerTxt);
   mergeAdapter.addAdapter(new cinemaAdapter(this,
 R.layout.cinema_row, cinema));

That much seems correct. The rest is your business logic which I only
sorta follow.

I have not tested MergeAdapter on Android 1.6 (part of my chores for
this weekend), so there is a chance it needs updating.

Try the demo activity that ships with MergeAdapter and see if it behaves
properly.

-- 
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
-~--~~~~--~~--~--~---



[android-developers] Re: listview header

2009-10-10 Thread Wouter

There is no problem with the MergeAdapter, I had the same issue in
1.5.

I have tried everything now but nothing works for me :s

On 10 okt, 15:58, Mark Murphy mmur...@commonsware.com wrote:
 Wouter wrote:
  I had uses the MergeAdapter with this code:

     public void retrieveVideotheek()
      {
             try {
                     HashMapString, Object response = (HashMapString, 
  Object)
  client.call(film.retrieveTv, sessionKey);

                     Iterator it = response.entrySet().iterator();

                 while (it.hasNext()) {
                     cinema = new ArrayListFilmDetail();
                     Map.Entry pairs = (Map.Entry)it.next();
                     Object[] cinemaFilms = (Object[])pairs.getValue();
                     FilmDetail cinemaMovie = new FilmDetail();

                     for (int i=0; icinemaFilms.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(EE,
  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?

 Off the top of my head, I have no idea.

                     mergeAdapter.addView(headerTxt);
                     mergeAdapter.addAdapter(new cinemaAdapter(this,
  R.layout.cinema_row, cinema));

 That much seems correct. The rest is your business logic which I only
 sorta follow.

 I have not tested MergeAdapter on Android 1.6 (part of my chores for
 this weekend), so there is a chance it needs updating.

 Try the demo activity that ships with MergeAdapter and see if it behaves
 properly.

 --
 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
-~--~~~~--~~--~--~---