[android-developers] Re: What is the correct way to refresh UI when I use android:configChanges=keyboardHidden|orientation

2009-04-28 Thread quakeboy
You might want to take a look at setRequestedOrientation if u want to .. On Apr 24, 1:53 pm, 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,

[android-developers] Re: What is the correct way to refresh UI when I use android:configChanges=keyboardHidden|orientation

2009-04-27 Thread Wang He
1. I don't want to recreate the activity when switching at Land Port, many runtime data I don't want to save and reload; 2. So I use onConfigurationChanged() facility, but I have UI for Land Port, What I do now is: public void onConfigurationChanged(Configuration newConfig) {

[android-developers] Re: What is the correct way to refresh UI when I use android:configChanges=keyboardHidden|orientation

2009-04-27 Thread Android Users
Hi, There are various options mentioned here. http://www.devx.com/wireless/Article/40792/0/page/1 see if this helps... On Mon, Apr 27, 2009 at 1:55 PM, Wang He iptvph...@gmail.com wrote: 1. I don't want to recreate the activity when switching at Land Port, many runtime data I don't want to

[android-developers] Re: What is the correct way to refresh UI when I use android:configChanges=keyboardHidden|orientation

2009-04-27 Thread MrSnowflake
You don't have to load and save that stuff, you can put references to your runtime data in a custom class and return that in Activity.onRetainNonConfigurationInstance() (http:// developer.android.com/reference/android/app/ Activity.html#onRetainNonConfigurationInstance()) and get it in

[android-developers] Re: What is the correct way to refresh UI when I use android:configChanges=keyboardHidden|orientation

2009-04-27 Thread Dianne Hackborn
You realize that you need to save and restore your state to work correctly anyway, right? If you don't, you will lose your state when the user returns to it after it was killed in the background. So do that first. Seriously. You have to do it anyway. Then once you have that working, you can

[android-developers] Re: What is the correct way to refresh UI when I use android:configChanges=keyboardHidden|orientation

2009-04-26 Thread Wang He
Is here anybody knows the right way? Still waiting ... BRs He On Apr 24, 4:53 pm, 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

[android-developers] Re: What is the correct way to refresh UI when I use android:configChanges=keyboardHidden|orientation

2009-04-26 Thread Dianne Hackborn
If you actually have resources that change due to these states, you really should consider letting the normal destroy/recreate behavior execute. Otherwise, you will just need to poke through your UI, reloading and resetting resources that may have changed. There is no simple answer that can be

[android-developers] Re: What is the correct way to refresh UI when I use android:configChanges=keyboardHidden|orientation

2009-04-24 Thread MrSnowflake
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,