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

Change-Id: I1c67a6603c23d15fef9a6912c86ffdf77aaa8654
This commit is contained in:
Dianne Hackborn
2010-06-04 14:34:29 -07:00
parent d0b15cecc6
commit c39a5dcbe1

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);
}
}