Merge "Fix issue #2733766: Crash in Gallery onDestroy: java.lang.RuntimeException"

This commit is contained in:
Dianne Hackborn
2010-06-04 15:26:35 -07:00
committed by Android (Google) Code Review

View File

@@ -2068,8 +2068,10 @@ public class Activity extends ContextThemeWrapper
public void onContentChanged() {
// First time content is available, let the fragment manager
// attach all of the fragments to it.
if (mFragments.mCurState < Fragment.CONTENT) {
// attach all of the fragments to it. Don't do this if the
// activity is no longer attached (because it is being destroyed).
if (mFragments.mCurState < Fragment.CONTENT
&& mFragments.mActivity != null) {
mFragments.moveToState(Fragment.CONTENT, false);
}
}