Wednesday, February 15, 2012

[android-developers] Re: What is wrong with Android Adapters?

Hi,

Thank you for answering.
I wanted to keep the post brief until I found someone interested.

I've got code for another adapter implementation on stackoverflow,
which show the exact same pattern in the calls to getView.
Though this is a CursorTreeAdapter, so it calls "newView" and
"bindView" for me in its implementation of "getView"
http://stackoverflow.com/questions/9250781/cursortreeadapter-binding-views-excessivly-very-weird-behaviour

Any adapter I implement have the same pattern in how getView is
called.
They all look like they work perfectly, until you look closer on how
the methods are called.

Specially the 3x rebinding of all views when I enter powerdown is very
curious.
(There is nothing done in onPause that should affect the list)

Here is a third adapter that also show the exact same pattern, and is
the most minmal I have:
http://pastebin.com/hutfJPcN

It implements ListAdapter, because at that point I had overlooked
BaseListAdapter, but it shouldn't matter.

Cheer,
Olof

On Feb 15, 12:43 am, Doug <beafd...@gmail.com> wrote:
> On Feb 13, 1:48 am, Olof Hedman <o...@illusionlabs.se> wrote:
>
> > Is there anyone who can shed some light on this, is it just something
> > I have to live with, or have I made some stupid mistake?
> > I have a hard time imagining anything I could have done wrong though,
> > since the code is really minimal.
>
> Why aren't you showing your code, since it is so minimal?  Your log
> isn't helping anyone understand what you actually did.  BTW, "minimal"
> doesn't equate to "correct".
>
> If anything at all is invalidating views in your list, it may be
> getting rebuilt.  If your adapter is getting refreshed somehow, it may
> be getting rebuilt.
>
> You could also try starting with a sample from ApiDemos and building
> from there.
>
> Doug

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment