commit | b0ee08109ec89959d9bbd526c6e5f7ab96c8c3ea | [log] [tgz] |
---|---|---|
author | Adam Cohen <adamcohen@google.com> | Tue Dec 03 10:51:45 2013 -0800 |
committer | Adam Cohen <adamcohen@google.com> | Tue Dec 03 10:52:21 2013 -0800 |
tree | ac35acc9283717d5bc80aa7280d380af3cc2bc65 | |
parent | b3084e87fcf7b617899b3c858d5372d079e0fe36 [diff] |
Add guards for restoreInstanceState (issue 11982812) Change-Id: Ic4c632a956130ab28843085490dc1badb39b0e8c
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index 4d9dff9..74f28b3 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java
@@ -2298,7 +2298,7 @@ r = new Runnable() { public void run() { Callbacks callbacks = tryGetCallbacks(oldCallbacks); - if (callbacks != null) { + if (callbacks != null && currentScreen >= 0) { callbacks.onPageBoundSynchronously(currentScreen); } }
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 3b7afc7..c6c6e13 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java
@@ -4254,7 +4254,9 @@ if (mSavedStates != null) { mRestoredPages.add(child); CellLayout cl = (CellLayout) getChildAt(child); - cl.restoreInstanceState(mSavedStates); + if (cl != null) { + cl.restoreInstanceState(mSavedStates); + } } }