title: No view found for id 0x7f0800c4 for fragment
body: <p>I get this error when I am trying to replace the parent fragment (<code>SearchFragment</code>) from the child fragment (<code>ClassroomsTab</code>) in a swipe tab <code>viewPager</code>. Basically what I am trying to achieve is have a swipe tab menu with multiple buttons in each child fragment that closes the swipe tab menu and open a different existing fragment. The <code>SearchFragment</code> is in a Navigation Drawer activity and so is the destination fragment of the buttons.</p>
  
  <p>From what I have read, a solution to this issue is to replace the <code>getChildFragmentManager()</code> in this line of code: <code>viewPager.setAdapter(new MyAdapter(getChildFragmentManager()));</code> with <code>getActivity().getSupportFragmentManager()</code> or <code>getFragmentManager()</code>. This solves the issue of the app crashing, but when I click back on the search tab through the navigation drawer from the new fragment, most of the swipe tab child fragments with the buttons don't show up. </p>
  
  <p>Thanks for the help :)</p>
  
  <p><code>SearchFragment</code> <code>OnCreateView</code> code:</p>
  
  <pre><code>public TabLayout tabLayout;
      public ViewPager viewPager;
      public static int int_items = 5;
  
      @Nullable
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
          //this inflates the tab layout file.
          View view =  inflater.inflate(R.layout.search_layout,null);
          viewPager = (ViewPager) view.findViewById(R.id.viewpager);
          tabLayout = (TabLayout) view.findViewById(R.id.tabs);
  
          viewPager.setAdapter(new MyAdapter(getChildFragmentManager()));  
  
          // this puts the titles on the top
          tabLayout.post(new Runnable() {
              @Override
              public void run() {
                  tabLayout.setupWithViewPager(viewPager);
              }
          });
          //this preloads the other tabs. currently only have it set to one for testing
          viewPager.setOffscreenPageLimit(1);
  
          return view;
  
      }
  </code></pre>
  
  <p><code>ClassroomsTab</code> code (with only one button for now while I'm testing):</p>
  
  <p>note: <code>content_frame</code> is the framelayout of the navigation activity</p>
  
  <pre><code>public class ClassroomsTab extends Fragment {
  View myView;
  @Nullable
  @Override
  public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
      myView = inflater.inflate(R.layout.classrooms, container, false);
      defineButtons();
      return myView;
  }
  public void defineButtons() {
      Button CR1C1 = (Button)myView.findViewById(R.id.CR1C1);
      CR1C1.setOnClickListener(buttonClickListener);
  
  }
  private View.OnClickListener buttonClickListener = new View.OnClickListener() {
      @Override
      public void onClick(View view) {
          FragmentManager fragmentmanager = getFragmentManager();
          switch (view.getId()) {
              case R.id.CR1C1:
                  fragmentmanager.beginTransaction()
                          .replace(R.id.content_frame
                                  ,new MapFragment())
                          .commit();
                  break;
          }
      }
  };
  </code></pre>
  
  <p>Full error</p>
  
  <blockquote>
    <p>09-08 15:52:13.154 12220-12220/com.example.jeremy.app E/AndroidRuntime: FATAL EXCEPTION: main
        Process: com.example.jeremy.app, PID: 12220
        java.lang.IllegalArgumentException: No view found for id 0x7f0800c4 (com.example.jeremy.app:id/content_frame) for fragment MapFragment{c7d968f #2 id=0x7f0800c4}
            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1417)
            at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1754)
            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1822)
            at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
            at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2591)
            at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2378)
            at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2333)
            at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2240)
            at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:703)
            at android.os.Handler.handleCallback(Handler.java:790)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:164)
            at android.app.ActivityThread.main(ActivityThread.java:6494)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)</p>
  </blockquote>