Of course I'm guessing, but I think you should change the way you transfer 
the new date/time value to the text widget.

In the activity, say A1, you create the dialog and give it a reference to 
the text field of A1. When the device is rotated, the activity is recreated 
(=> A2), but the dialog is not (due to this.setRetainInstance(true);). I.e. 
the dialog still references the text field of A1, but you see the activity 
A2. That's probably the cause of the observed behavior. As far as I 
understand it, the way to go is to add a "setDateTimeField()" method to the 
activity and to replace the code in the onClick method of the dialog with 
something like 
"((MyActivityClass)getActivity()).setDateTimeField(curDateTime()). 
GetActivity() will return the current/correct activity since the dialog 
will be attached to new activity as part of the configuration change.

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