diff options
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 26f14d3ae..981941e5c 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -659,6 +659,12 @@ public class Workspace extends SmoothPagedView if (customContent instanceof Insettable) { ((Insettable)customContent).setInsets(mInsets); } + + // Verify that the child is removed from any existing parent. + if (customContent.getParent() instanceof ViewGroup) { + ViewGroup parent = (ViewGroup) customContent.getParent(); + parent.removeView(customContent); + } customScreen.removeAllViews(); customScreen.addViewToCellLayout(customContent, 0, 0, lp, true); mCustomContentDescription = description; |