What is the correct way to refresh UI when I use android:configChanges="keyboardHidden|orientation"

by MrSnowflake » Fri, 24 Apr 2009 21:01:27 GMT


Sponsored Links
 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 :).



--~--~---------~--~----~------------~-------~--~----~



What is the correct way to refresh UI when I use android:configChanges="keyboardHidden|orientation"

by Wang He » Mon, 27 Apr 2009 10:56:20 GMT


 Is here anybody knows the right way?
Still waiting ...

BRs
He



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


What is the correct way to refresh UI when I use android:configChanges="keyboardHidden|orientation"

by Wang He » Mon, 27 Apr 2009 16:26:10 GMT


 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) {
           setContentView() again as onCreate();
          run findViewById()s as handlers will lost after
setContentView();
          setListeners for UI widgets as they will lost also;
  }

3. Is the way right I did in 2?

BRs
He





--~--~---------~--~----~------------~-------~--~----~



What is the correct way to refresh UI when I use android:configChanges="keyboardHidden|orientation"

by MrSnowflake » Mon, 27 Apr 2009 19:52:06 GMT


 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
Activity.getLastNonConfigurationInstance().






--~--~---------~--~----~------------~-------~--~----~



What is the correct way to refresh UI when I use android:configChanges="keyboardHidden|orientation"

by quakeboy » Tue, 28 Apr 2009 17:17:00 GMT


 You might want to take a look at setRequestedOrientation if u want
to ..



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. How can I change the look of the front screen of the Android?

Hi sorry I am not really following you enough to answer.  Fwiw, if you are
wanting to change the location of a view inside of the window while it is
animating, I think it will be impossible to do this without {*filter*} drawing
glitches.  That is why the status bar uses two windows for the two planes
that animate when sliding down/up.











-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website:  http://www.***.com/ 

2. magic 32a E: can't open/cache/recovery/command

brother android sekalian,
saya kemaren coba bantuin temen yang baru keracunan magic, dia dapet magic
yang udah ada myhero-nya.
karena mau wipe data biar bersih kek baru lagi, saya download rom myhero
2.0.4.
md5 verified, update.zip sudah saya masukkan ke dalam sdcard.

ketika saya masuk recovery mode, tampak ada E: can't
open/cache/recovery/command di bagian bawahnya.
saya wipe terlebih dahulu, dan ketika saya coba apply update, muncul error:
E: No signature (737 files)
E: Verification failed
Installation aborted.

ini kenapa ya? saya sudah coba format sdcard dan apply update lagi hasilnya
masih sama..
mohon pencerahan dari suhu-suhu droid sekalian.. :D

thanks!
-adit-

--~--~---------~--~----~------------~-------~--~----~
=========================
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group:

Click  

3. What is the difference between default android apps and sdk built apps in donut?

4. how to remove statusbar animation when chang to fullscreen.

5. how to remove statusbar animation when chang to fullscreen.

6. Motorola Motus Image and Specs Arrive | AndroidGuys

7. Android Eclair -- hangs after gralloc/mapFrameBufferLocked