title: Re-arrange the view order on Framelayout android
body: <p>I've add five views on frameLayout.</p>
  
  <p>how to re arrange the childIndex of framelayout.</p>
  
  <p>i use below code: </p>
  
  <pre><code>fromindex  = 3;
  toindex    = 4;
  View tempFrom = frameLayout.getChildAt(fromindex);
  View tempTo   = frameLayout.getChildAt(toindex);
  frameLayout.removeViewAt(fromindex)
  frameLayout.removeViewAt(toindex)
  frameLayout.addView(tempFrom, toindex)
  frameLayout.addView(tempTo,fromindex)
  </code></pre>
  
  <p>But its throws the below error.</p>
  
  <pre><code>java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
  </code></pre>
  
  <p>How to re arrange the childindex of framelayout ?</p>