On Mon, Apr 22, 2013 at 2:36 PM, bob <[email protected]> wrote:

> The field still says "don't phone home" even though the et.setText("phone
> home"); code ran again.
>
> Can someone help me understand this?
>

The EditText, like many built-in controls, saves and restores it's state as
part of the configuration change. The same thing would happen with a
checkbox.

While you changed the text in onCreate, an Activity calls onRestoreInstance
state *after* onCreate, at which point the EditText's previously saved
value is restored. This is a good thing as it prevents you from having to
write save / restore code for everything in your UI.

Read the documentation on the activity life cycle for more details.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to