I noticed something today that I found very confusing.

I noticed that, if I have some EditText fields that are partly filled in 
and the phone gets rotated, the fields retain their data.  This retention 
of data occurs in spite of code that suggests the data ought to be reset.

I made a small unit test to demonstrate this.  Basically, it's just one 
EditText field.

Then I put this in onCreate:

        EditText et =  (EditText) findViewById(R.id.editText1);
        et.setText("phone home");

Then, let's say I change the text field to "don't phone home".  Then I 
rotate the device.

The field still says "don't phone home" even though the et.setText("phone 
home"); code ran again.

Can someone help me understand this?

Thanks.



-- 
-- 
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