On Sat, Apr 23, 2011 at 7:19 AM, Taf <[email protected]> wrote:
> 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?

It does not force you to reload all of your resources. Hence, you have
to do all that yourself.

You might think "well, gee, it's portrait <-> landscape, so I just
fiddle with my layout, how tough can that be?". But then, what happens
if the user changes their locale while your app is in memory? They
come back to your app, and either:

1. You added locale to your android:configChanges attribute, in which
case you have to have all of the code yourself to reload all of your
visible strings, and not miss any

2. You only have rotation-related values in android:configChanges, in
which case your app probably crashes or otherwise has results that you
don't like, because the old activity will be destroyed and a new
activity created

There are a fair number of configuration changes (see the docs for
android:configChanges). One way or another, you have to handle all of
them. Using android:configChanges, therefore, is best for places where
the pain of manual resource management (and getting right now and as
you change resources in the coming months) is still less than the pain
caused by destroying and recreating an activity.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://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