summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-06-19 13:31:14 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-06-19 13:31:14 -0700
commit4d1b5bd148d0830d2acc03bafbe58dfd17e5b3f8 (patch)
tree4ab04475ff5ed8b95909283232d1200bbe27719c /core/java
parent066e6bfd01a5ddd4748eacdc82fee5374e2af929 (diff)
parente35c23514592efe07d54fdbed7e7ec0b717e8bbe (diff)
downloadframeworks_base-4d1b5bd148d0830d2acc03bafbe58dfd17e5b3f8.zip
frameworks_base-4d1b5bd148d0830d2acc03bafbe58dfd17e5b3f8.tar.gz
frameworks_base-4d1b5bd148d0830d2acc03bafbe58dfd17e5b3f8.tar.bz2
Merge change 4808 into donut
* changes: Fixes #1928566. Prevents runtime restart upon configuration change.
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/Activity.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 51a8ed2..ca9632a 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -864,7 +864,9 @@ public class Activity extends ContextThemeWrapper
final Integer dialogId = ids[i];
Bundle dialogState = b.getBundle(savedDialogKeyFor(dialogId));
if (dialogState != null) {
- final Dialog dialog = createDialog(dialogId);
+ // Calling onRestoreInstanceState() below will invoke dispatchOnCreate
+ // so tell createDialog() not to do it, otherwise we get an exception
+ final Dialog dialog = createDialog(dialogId, false);
mManagedDialogs.put(dialogId, dialog);
onPrepareDialog(dialogId, dialog);
dialog.onRestoreInstanceState(dialogState);
@@ -872,13 +874,13 @@ public class Activity extends ContextThemeWrapper
}
}
- private Dialog createDialog(Integer dialogId) {
+ private Dialog createDialog(Integer dialogId, boolean dispatchOnCreate) {
final Dialog dialog = onCreateDialog(dialogId);
if (dialog == null) {
throw new IllegalArgumentException("Activity#onCreateDialog did "
+ "not create a dialog for id " + dialogId);
}
- dialog.dispatchOnCreate(null);
+ if (dispatchOnCreate) dialog.dispatchOnCreate(null);
return dialog;
}
@@ -2430,7 +2432,7 @@ public class Activity extends ContextThemeWrapper
}
Dialog dialog = mManagedDialogs.get(id);
if (dialog == null) {
- dialog = createDialog(id);
+ dialog = createDialog(id, true);
mManagedDialogs.put(id, dialog);
}