Hi Mark,

Yes, I think I'll have to look at using the the way you've suggested.
It was just that
onConfigurationChanged seemed like a really nice and simple way of
achieving what I wanted. Though
it does say somewhere in the docs that it should be used as a last
resort. Not sure why? I guess it
circumnavigates all the Activity life cycle calls and hence you can
end up getting memory leaks as I am seeing.

Thanks for the quick response.

On Apr 23, 12:05 pm, Mark Murphy <[email protected]> wrote:
> On Sat, Apr 23, 2011 at 6:55 AM, Taf <[email protected]> wrote:
> > I'm using a ListActivity, with onConfigurationChanged. I'm doing this
> > because I don't want onCreate to be called so i don't have to reload
> > data in the list view every time I change orientation.
>
> That is a poor rationale. Use onSaveInstanceState() and
> onRetainNonConfigurationInstance() to hold onto your data model
> between the old and new instances, please.
>
> > I've found that when I call setListAdapter in the onCreate method of
> > my ListActivity , after a Number of orientation changes I get an out
> > of memory error. If I don't set the ListAdapter I don't see the out of
> > memory error.
>
> > Just wondering if anyone else has seen this and knows of a way to
> > solve it?
>
> Fix your Adapter implementation.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android 3.0 Programming Books:http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to