title: No view found for ID xxx for fragment (nested fragments)
body: <p>I have an activity that has a ViewPager in the layout.</p>
  
  <p>I have two fragments which display, one for each tab.</p>
  
  <p>One of the fragments is designed to host other fragments - this is the <code>CustomerMainFragment</code> which inflates <code>fragment_customer_main</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/lyt_customer_main"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;FrameLayout
          android:id="@+id/fragment_customer_content"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This then adds <code>CustomerSearchFragment</code> to the <code>FrameLayout</code> which inflates <code>fragment_customer_search</code>.</p>
  
  <p><code>CustomerSearchFragment</code> also has the following override to switch out the search fragment for a detail fragment on a button press:</p>
  
  <pre><code>@Override
  public void onViewCreated(View view, Bundle savedInstanceState) {
      super.onViewCreated(view, savedInstanceState);
  
      Button btnSearch1 = (Button) view.findViewById(R.id.button1);
      if (btnSearch1 != null) {
          btnSearch1.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  // This is important bit
                  Fragment customerDetailFragment = new CustomerDetailFragment();
                  FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
                  transaction.addToBackStack(null);
                  transaction.replace(R.id.fragment_customer_content, customerDetailFragment).commit();
  
              }
          });
      }
  }
  </code></pre>
  
  <p>After clicking the button I get the following error:</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: No view found for id 0x7f080006
    (com.chrisbeckyapps.sample:id/fragment_customer_content) for fragment
    CustomerDetailFragment{4280b0b8 #0 id=0x7f080006}</p>
  </blockquote>
  
  <p>I'm new to fragments and understand the concepts, but I'm stumped by this.  I originally had the search fragment going straight into the pager, but then replacing it with the detail fragment mean it just showed over the top, and my research led to this being a better solution.</p>
  
  <p>I have wondered about trying to move the search logic to the <code>CustomerMainFragment</code> but this means hooking up a lot of logic and I thought you could embed logic within fragments.</p>
  
  <p>Suggestions?</p>