title: Can't Able to add two FrameLayout Objects in LinearLayout programmatically
body: <p>while adding two FrameLayout Objects in LinearLayout Object Programmatically, getting the following exception on adding second FrameLayout object to LinearLayout object. Can anyone help.</p>
  
  <p>Java.Lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.</p>
  
  <p>here is the code</p>
  
  <pre><code>ViewGroup.LayoutParams param = new ViewGroup.LayoutParams(
                                 ViewGroup.LayoutParams.WrapContent, 
                                 ViewGroup.LayoutParams.WrapContent);
  
  MainView = new LinearLayout(_context);
  MainView.LayoutParameters = new ViewGroup.LayoutParams(
                              ViewGroup.LayoutParams.MatchParent, 
                              ViewGroup.LayoutParams.MatchParent);
  
  MainView.Orientation = Orientation.Vertical;
  MainView.SetVerticalGravity(GravityFlags.Center);
  MainView.SetHorizontalGravity(GravityFlags.Center);
  
  
  
  
  _currentSwipableItemReflectionFrameLayout = _currentSwipableItemFrameLayout;
  _currentSwipableItemReflectionFrameLayout.RotationX = 180;
  _currentSwipableItemReflectionFrameLayout.Alpha = 0.3f;
  
  MainView.AddView(_currentSwipableItemFrameLayout,param);
  MainView.AddView(_currentSwipableItemReflectionFrameLayout,param);
  
  AddView(MainView);
  </code></pre>