I have a class 'GListView' which extends ListView and acts as it's own
adapter.  It is declared thus:

public class GListView extends ListView implements ListAdapter

In it's constructor, I set it's adapter to itself as follows:

public GListView(Context context ...)
{
...

    setAdapter(this);

...
}

I then add this GListView to a ViewGroup.  Later I release all
references to the ViewGroup, and yet the ViewGroup and the GListView
are never garbage collected.

Now if I don't do the 'setAdapter(this)' call, everything the garbage
collection works as expected, so it seems that setting the adapter to
itself is creating some kind of circular references that the garbage
collector is not able to sort out

I have tried calling setAdapter(null) when I no longer need the view,
but that does not seem to help.

Is having my GListView act as it's own ListAdapter something I simply
cannot do, or is there some way to make this work?

Thanks.

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

Reply via email to