summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2013-11-26 14:55:45 -0800
committerDanesh M <daneshm90@gmail.com>2014-06-06 22:54:20 -0700
commit35dc8fece92930977f7a97091af2866958ac7d51 (patch)
treeffa68349d5bc7bd64a7295bf9bb65b24fac21790 /src
parentb00e63923591c8cd28c77ba2c69fd077cf540d51 (diff)
downloadandroid_packages_apps_Trebuchet-35dc8fece92930977f7a97091af2866958ac7d51.tar.gz
android_packages_apps_Trebuchet-35dc8fece92930977f7a97091af2866958ac7d51.tar.bz2
android_packages_apps_Trebuchet-35dc8fece92930977f7a97091af2866958ac7d51.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 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;