title: How to add a View to a ViewFlipper while it has been set an Adapter ? (The specified child already has a parent)
body: <p>I'm making a <code>GridView</code> to dynamically contain a set of clickable icons, so I need to set an Adapter on this <code>GridView</code>, and add a Listener.</p>
  
  <p><code>mGridView = (GridView) view.findViewById(R.id.listbody);<br>
          mGridView.setAdapter(new ListAppAdapter());<br>
          mGridView.setOnItemClickListener(this);
  </code></p>
  
  <p>And I'd wrote the Adapter myself:</p>
  
  <p><code>
  class ListAppAdapter extends BaseAdapter {<br>
  ...<br>
  public View getView(int position, View convertView, ViewGroup parent) {...}<br>
  ...<br>
  }
  </code></p>
  
  <p>Now I need this <code>GridView</code> to slide from side to side by gesture, so I tried <code>ViewFlipper</code>:</p>
  
  <p><code>
          mFlipper = (ViewFlipper) mInflate.inflate(R.layout.main, (ViewGroup)findViewById(R.id.ViewFlipper));<br>
          mFlipper.addView(mGridView);<br>
          mDetector = new GestureDetector(this);
  </code></p>
  
  <p>BUT I got an Exception:</p>
  
  <p><code>The specified child already has a parent. You must call removeView() on the child's parent first.</code></p>
  
  <p>Then I tried to wrap the <code>GridView</code> in another <code>FrameLayout</code> in the XML and add the <code>FrameLayout</code> to the<code>ViewFlipper</code>, The fling gesture was captured but the <code>GridView</code> didn't show up, I was Flinging the blank <code>FrameLayout</code>!</p>
  
  <p>Anyone know how to deal with this ?</p>
  
  <p>The XML and Layout parameters are all right, when I add a simple <code>ImageView</code> to the 'ViewFlipper', it works. </p>
  
  <p>And I've tried to remove all child views of the <code>ViewFlipper</code> and didn't add the same instance of the <code>GridView</code>. But when I add the <code>GridView</code>, the Exception still comes.</p>