summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2013-11-26 14:55:45 -0800
committerAdam Cohen <adamcohen@google.com>2013-11-26 14:56:18 -0800
commit166ebd4da5d85195bd1f562572f468726ade548f (patch)
tree9833e28f7d8c4b383627000e9cdade60aea431cc /src
parentd552dd90f1da32e1be2dd95ffed57c65d40cb651 (diff)
downloadandroid_packages_apps_Trebuchet-166ebd4da5d85195bd1f562572f468726ade548f.tar.gz
android_packages_apps_Trebuchet-166ebd4da5d85195bd1f562572f468726ade548f.tar.bz2
android_packages_apps_Trebuchet-166ebd4da5d85195bd1f562572f468726ade548f.zip
De-parent custom content view before adding to custom content screen
Bug: 11666352 Change-Id: Ief35e6e8a16ec0217e0dd27434723ee7a7d5beef
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/Workspace.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index b1b50bf5e..02949e7dd 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -619,6 +619,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;