diff options
author | Adam Cohen <adamcohen@google.com> | 2012-07-24 22:34:36 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2012-07-24 22:34:36 -0700 |
commit | 1462de39f01cec0ba785386532719cb0207dd827 (patch) | |
tree | 3204f51f6f91b97889fb180202d88f83a561c5ca /src/com/android/launcher2/Launcher.java | |
parent | a13a2f2a7bd0550d1ad973f760ff25e1a4137c43 (diff) | |
download | android_packages_apps_Trebuchet-1462de39f01cec0ba785386532719cb0207dd827.tar.gz android_packages_apps_Trebuchet-1462de39f01cec0ba785386532719cb0207dd827.tar.bz2 android_packages_apps_Trebuchet-1462de39f01cec0ba785386532719cb0207dd827.zip |
Ensuring that restoreInstanceState is being called promptly for synchronously bound page
Change-Id: I0e71c29f553ad360ec42a6a0b2529d16cbddd437
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 70c641b92..ae2ca3b47 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -278,6 +278,8 @@ public final class Launcher extends Activity private static Drawable.ConstantState[] sVoiceSearchIcon = new Drawable.ConstantState[2]; private static Drawable.ConstantState[] sAppMarketIcon = new Drawable.ConstantState[2]; + private final ArrayList<Integer> mSynchronouslyBoundPages = new ArrayList<Integer>(); + static final ArrayList<String> sDumpLogs = new ArrayList<String>(); // We only want to get the SharedPreferences once since it does an FS stat each time we get @@ -1413,9 +1415,11 @@ public final class Launcher extends Activity } @Override - protected void onRestoreInstanceState(Bundle savedInstanceState) { - // Do not call super here - mSavedInstanceState = savedInstanceState; + public void onRestoreInstanceState(Bundle state) { + super.onRestoreInstanceState(state); + for (int page: mSynchronouslyBoundPages) { + mWorkspace.restoreInstanceStateForChild(page); + } } @Override @@ -3314,6 +3318,10 @@ public final class Launcher extends Activity } } + public void onPageBoundSynchronously(int page) { + mSynchronouslyBoundPages.add(page); + } + /** * Callback saying that there aren't any more items to bind. * @@ -3329,10 +3337,7 @@ public final class Launcher extends Activity mSavedState = null; } - if (mSavedInstanceState != null) { - super.onRestoreInstanceState(mSavedInstanceState); - mSavedInstanceState = null; - } + mWorkspace.restoreInstanceStateForRemainingPages(); // If we received the result of any pending adds while the loader was running (e.g. the // widget configuration forced an orientation change), process them now. |