Thursday, May 27, 2010

[android-developers] What would cause an activity's private field to be cleared after onActivityResult?

I am seeing a rare exception: Let's say my main activity has a list of
data, called List<string> dataList. I initialize it in the onCreate
method of the Activity, so it should never be null during the lifetime
of an activity.

Yet, sometimes (very rare) after a sub-activity has finished and the
main activity's onActivityResult() is called, dataList becomes null.
It is as if while the sub-activity is running or finished running, the
main activity was recreated but onCreate was not called.

What else would have caused a main activity's state to become invalid,
while a sub-activity is being executed?

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment