diff options
author | Michael Jurka <mikejurka@google.com> | 2013-07-02 17:24:35 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2013-07-02 17:24:35 -0700 |
commit | ee0ce2b29f9cb06cc143c6f30ffc77f4915b0da9 (patch) | |
tree | 2317c953a2548f50a7bcaa0080dc1432fceb16d3 | |
parent | 04d554afcb5eeeaf5727c922e70d71817ec2d4af (diff) | |
download | android_packages_apps_Trebuchet-ee0ce2b29f9cb06cc143c6f30ffc77f4915b0da9.tar.gz android_packages_apps_Trebuchet-ee0ce2b29f9cb06cc143c6f30ffc77f4915b0da9.tar.bz2 android_packages_apps_Trebuchet-ee0ce2b29f9cb06cc143c6f30ffc77f4915b0da9.zip |
Fix NPE when drags are cancelled
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 9ee69be22..16c52ded5 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -499,9 +499,9 @@ public class Workspace extends SmoothPagedView CellLayout newScreen = (CellLayout) mLauncher.getLayoutInflater().inflate(R.layout.workspace_screen, null); - addView(newScreen, getChildCount()); mWorkspaceScreens.put(screenId, newScreen); mScreenOrder.add(screenId); + addView(newScreen, getChildCount()); if (updateDb) { // On bind we don't need to update the screens in the database. mLauncher.getModel().updateWorkspaceScreenOrder(mLauncher, mScreenOrder); @@ -525,10 +525,10 @@ public class Workspace extends SmoothPagedView AppWidgetHostView.getDefaultPaddingForWidget(mLauncher, mLauncher.getComponentName(), p); customContent.setPadding(p.left, p.top, p.right, p.bottom); - addView(customScreen, 0); - mWorkspaceScreens.put(CUSTOM_CONTENT_SCREEN_ID, customScreen); mScreenOrder.add(0, CUSTOM_CONTENT_SCREEN_ID); + addView(customScreen, 0); + // Ensure that the current page and default page are maintained. mDefaultPage++; |