Skip to content

Commit

Permalink
fix: BUG - The specified child already has a parent. You must call
Browse files Browse the repository at this point in the history
removeView() on the child's parent first.
  • Loading branch information
ChengTao committed Mar 19, 2018
1 parent 42cb24f commit 0f1a6ed
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ public boolean onTouchEvent(MotionEvent event) {
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
if (mHoldingCircle.getParent() != null){
((ViewGroup)mHoldingCircle.getParent()).removeView(mHoldingCircle);
}
getDecorView().addView(mHoldingCircle, mHoldingDrawable.getIntrinsicWidth(), mHoldingDrawable.getIntrinsicHeight());
}

Expand Down

0 comments on commit 0f1a6ed

Please sign in to comment.