Re: [android-developers] Re: Custom BaseAdapter + dynamic updates = crash in ListView layout

2010-02-17 Thread TreKing
On Tue, Feb 16, 2010 at 10:47 PM, whicken whic...@gmail.com wrote:

 Here's my GroupedListAdapter class, if that helps any - I added the
 getStableIds returning false in case there was any extra caching going
 on:


Here's a question - what's the purpose of this adapter? What kind of layout
/ functionality are you trying to achieve? It looks to me like you're
reproducing the ExpandablistList functionality in a very strange way.

First suggestion would be to stick a break point in every single function
and see what gets called and in what order. Also throw in some logging to
make sure your logic is correct in each and every function.

Beyond that I would strongly suggest reworking this class. Maybe take a look
at BaseExpandableListAdapter instead of the BaseAdapter? Or at least create
an object that represents a single header with some sections and delegate
some of the functionality to it instead of maintaining two lists and trying
to do the indexing yourself in the one class. That's bound to get confusing.

-
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking

-- 
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: Custom BaseAdapter + dynamic updates = crash in ListView layout

2010-02-17 Thread TreKing
On Wed, Feb 17, 2010 at 8:34 AM, whicken whic...@gmail.com wrote:

 I'm just trying to do a grouped layout - so a header would be followed
 by a bunch of rows, then another header, and another bunch of rows.
 They aren't collapsable, so I don't think it's quite an
 ExpandableList.


I would still recommend the ExpandableListAdapter since it matches your
header + list of sections design. You can easily override the collapsing
behavior and remove the default expanded / collapsed icon so it looks like a
generic list.

This gives you the benefit of reusing that class that's already provided to
you, separating the header and section Views instead of having one giant
view containing both, and makes it easier to support clicking on the header
or individual sections. Plus the option to re-enable the collapse behavior
if you decide you need it down the road.

-
TreKing - Chicago transit tracking app for Android-powered devices
http://sites.google.com/site/rezmobileapps/treking

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