Why do so much people avoid the destoying and recreation of Activities
on orientation change. It's there to make the switch to a different
orientation easier, because it automatically loads the correct
resources. To be honest, I don't fully understand the whole recreation
of Activities neither, as it would take a lot of time to recreate the
activity and loading (and saving the instance state too) the instance
state could take a long time too. But I bet those intelligent Google
people have good reasons, that's why I follow their idea.

I don't know how to refresh your UI. If you mean by refreshing:
loading the appropriate resources to get the correct layout for the
current orientation, then you need to destroy and recreate the
Activity. That's why the system does this by default!

You should save all current state specific information in
onSaveInstancestate() (or what is it called, I forgot, it's a couple
of weeks ago I did some Androiding :) ) and reload it in
onRestoreInstancestate(). And well, all this stuff is in the docs so
you can take a look there :).

On 24 apr, 10:53, Wang He <iptvph...@gmail.com> wrote:
> Hi all
>
> when I use android:configChanges="keyboardHidden|orientation" in my
> code, the activity will not destroy and recreate when I change from
> portrait to landscape, only onConfigurationChanged(newConfig) will be
> called by framework.
>
> The issue is:
> My UI cannot refresh by default, what is the correct way in
> onConfigurationChanged() to refresh my UI?
>
> BTW, my UI is write with mylayout.xml and added to my Widget by addView
> (inflator(mylayout.xml),null).
>
> Thanks in advance!!
> BRs
> Wang He
--~--~---------~--~----~------------~-------~--~----~
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