title: Dynamic inner Fragment in ViewPager overlapping
body: <p>Hi I've pseudoinfinite <code>ViewPager</code> with <code>FragmentStatePagerAdapter</code>. I dynamically add <code>CalendarFragment</code>s into it. I have member variable <code>mUpdatedShiftsCont</code> what is connect point to another inner fragment: </p>
  
  <p><strong>CalendarFragment.java:</strong></p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
    ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.calendar_fragment, container, false);
    mCalendarView = (GridView) rootView.findViewById(R.id.calendar);
    mUpdatedShiftsCont = (FrameLayout)  rootView.findViewById(R.id.calendar_updated_shifts_container);
  
    return rootView;
  }
  </code></pre>
  
  <p><strong>layout.calendar_fragment:</strong></p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/calendar_fragment_id"
    android:orientation="vertical" &gt;
  
    ...
  
    &lt;FrameLayout
       android:paddingTop="30dp"
       android:layout_width="fill_parent"
       android:layout_height="fill_parent"
       android:id="@+id/calendar_updated_shifts_container" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>When I try add inner fragment to connect point,</p>
  
  <pre><code>getFragmentManager().beginTransaction()
    .add(mUpdatedShiftsCont.getId(), fragment).commit();
  </code></pre>
  
  <p>all nested fragments are placed in one parent fragment in <code>ViewPager</code>:</p>
  
  <p><img src="https://i.stack.imgur.com/YyYbG.png" width="250"></p>
  
  <p>Does anyone have idea how to solve this? Thanks in advance.</p>