Add guards for restoreInstanceState (issue 11982812)

Change-Id: Ic4c632a956130ab28843085490dc1badb39b0e8c
This commit is contained in:
Adam Cohen
2013-12-03 10:51:45 -08:00
parent b3084e87fc
commit b0ee08109e
2 changed files with 4 additions and 2 deletions

View File

@@ -2298,7 +2298,7 @@ public class LauncherModel extends BroadcastReceiver {
r = new Runnable() {
public void run() {
Callbacks callbacks = tryGetCallbacks(oldCallbacks);
if (callbacks != null) {
if (callbacks != null && currentScreen >= 0) {
callbacks.onPageBoundSynchronously(currentScreen);
}
}

View File

@@ -4254,7 +4254,9 @@ public class Workspace extends SmoothPagedView
if (mSavedStates != null) {
mRestoredPages.add(child);
CellLayout cl = (CellLayout) getChildAt(child);
cl.restoreInstanceState(mSavedStates);
if (cl != null) {
cl.restoreInstanceState(mSavedStates);
}
}
}