title: android - add Fragment in containerViewId to Fragment in ViewPager
body: <p>I'm faced with following problem:</p>
  
  <p><code>MainActivity</code> is mainly a <code>ViewPager</code> where I can slide through cards (<code>Fragment</code>). This cards have a placeholder <code>ViewGroup</code> where another content (<code>Fragment</code>) is placed in during runtime. The problem is that the content is placed only in one card.</p>
  
  <p><strong>MainActivity</strong></p>
  
  <pre><code>public class MainActivity extend FragmentActivity {
  
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          // ...
          // init ViewPager
          getViewPager().setAdapter(new CardSelectionAdapter(getSupportFragmentManager()));
      }
  
      // ...
  
      private class CardSelectionAdapter extends FragmentPagerAdapter {
          // ...
  
          public Fragment getItem(int position) {
              return new CardFragment(someData);
          }
      }
  }
  </code></pre>
  
  <p><strong>CardFragment</strong></p>
  
  <pre><code>public class CardFragment extends Fragment {
  
       public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          ViewGroup rootView = (ViewGroup) inflater.inflate(R.layout.card, container, false);
          rootView.findViewById(R.id.actionSheet).setVisibility(View.GONE);
          return rootView;
      }
  
      public void populate() {
          // ...
  
          Fragment f;
          switch (type) {
              case TYPE_A: f = new ActionsAFragment(); break;
              case TYPE_B: f = new ActionsBFragment(); break;
              default: f = null;
          }
  
          if (f != null) {
              // Here should be the main problem when adding Fragment to container/placeholder
              getFragmentManager().beginTransaction().add(R.id.actionSheet, f).commit();
              getView().findViewById(R.id.actionSheet).setVisibility(View.VISIBLE);
  
          }
      }
  }
  </code></pre>
  
  <p>I think because all cards belong to <code>MainActivity</code>, <code>FragmentTransaction</code> can only add to one <code>ViewGroup</code> with <code>id R.id.actionSheet</code>.</p>
  
  <p>Is there another way how I can add content to layout with same ids?</p>