title: Call removeView() on the child's parent first
body: <p>First a little background:</p>
  
  <p>I have a layout inside a scrollview. At first, when the user scrolls on the screen, the scrollview scrolls. However, after a certain amount of scroll, I was to disable the scroll on the scroll view the move the "scroll focus" onto a webview inside the child layout. This way, the scrollview sticks and all the scroll events go to the webview inside it.</p>
  
  <p>So, for a solution, when the scroll threshold is reached, I remove the child layout from the scrollview and put it in scrollview's parent.(And make the scrollview invisible).</p>
  
  <pre><code>// Remove the child view from the scroll view
  scrollView.removeView(scrollChildLayout);
  
  // Get scroll view out of the way
  scrollView.setVisibility(View.GONE);
  
  // Put the child view into scrollview's parent view
  parentLayout.addView(scrollChildLayout);
  </code></pre>
  
  <p>General Idea: (-> means contains)</p>
  
  <p>Before: parentlayout -> scrollview -> scrollChildLayout</p>
  
  <p>After : parentLayout -> scrollChildLayout</p>
  
  <p>The above code is giving me this exception:</p>
  
  <pre><code>java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
             at android.view.ViewGroup.addViewInner(ViewGroup.java:1976)
             at android.view.ViewGroup.addView(ViewGroup.java:1871)
             at android.view.ViewGroup.addView(ViewGroup.java:1828)
             at android.view.ViewGroup.addView(ViewGroup.java:1808)
  </code></pre>
  
  <p>Do you know what's going on? I am clearly calling removeView on the parent.</p>