Further work on fragments:
- Implement all of the state saving and restoring machinery. This
caused some flux in the API.
- Add ability to have fragments that are retained across activity
instances.
- Fix some bugs.
Change-Id: Ib6b5b0752d7f8d667cfdcd3e76d127cc9b6d901b
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 3ec8bba..1f2fa26 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -1300,8 +1300,7 @@
Window window;
Activity parent;
String embeddedID;
- Object lastNonConfigurationInstance;
- HashMap<String,Object> lastNonConfigurationChildInstances;
+ Activity.NonConfigurationInstances lastNonConfigurationInstances;
boolean paused;
boolean stopped;
boolean hideForNow;
@@ -2479,7 +2478,7 @@
public final Activity startActivityNow(Activity parent, String id,
Intent intent, ActivityInfo activityInfo, IBinder token, Bundle state,
- Object lastNonConfigurationInstance) {
+ Activity.NonConfigurationInstances lastNonConfigurationInstances) {
ActivityRecord r = new ActivityRecord();
r.token = token;
r.ident = 0;
@@ -2488,7 +2487,7 @@
r.parent = parent;
r.embeddedID = id;
r.activityInfo = activityInfo;
- r.lastNonConfigurationInstance = lastNonConfigurationInstance;
+ r.lastNonConfigurationInstances = lastNonConfigurationInstances;
if (localLOGV) {
ComponentName compname = intent.getComponent();
String name;
@@ -2610,14 +2609,12 @@
+ r.activityInfo.name + " with config " + config);
activity.attach(appContext, this, getInstrumentation(), r.token,
r.ident, app, r.intent, r.activityInfo, title, r.parent,
- r.embeddedID, r.lastNonConfigurationInstance,
- r.lastNonConfigurationChildInstances, config);
+ r.embeddedID, r.lastNonConfigurationInstances, config);
if (customIntent != null) {
activity.mIntent = customIntent;
}
- r.lastNonConfigurationInstance = null;
- r.lastNonConfigurationChildInstances = null;
+ r.lastNonConfigurationInstances = null;
activity.mStartedActivity = false;
int theme = r.activityInfo.getThemeResource();
if (theme != 0) {
@@ -3618,8 +3615,8 @@
}
if (getNonConfigInstance) {
try {
- r.lastNonConfigurationInstance
- = r.activity.onRetainNonConfigurationInstance();
+ r.lastNonConfigurationInstances
+ = r.activity.retainNonConfigurationInstances();
} catch (Exception e) {
if (!mInstrumentation.onException(r.activity, e)) {
throw new RuntimeException(
@@ -3628,18 +3625,6 @@
+ ": " + e.toString(), e);
}
}
- try {
- r.lastNonConfigurationChildInstances
- = r.activity.onRetainNonConfigurationChildInstances();
- } catch (Exception e) {
- if (!mInstrumentation.onException(r.activity, e)) {
- throw new RuntimeException(
- "Unable to retain child activities "
- + safeToComponentShortString(r.intent)
- + ": " + e.toString(), e);
- }
- }
-
}
try {
r.activity.mCalled = false;