title: Android Fragment Error: No View Found For ID
body: <p>The error in logcat: <code>E/FragmentManager(7158): No view found for id 0x7f05000d (com.mybiz.mygame:id/fragment_container) for fragment MainMenuFragment{4052d780 #0 id=0x7f05000d}</code></p>
  
  <p>Ok here is how the app is set up:</p>
  
  <p>Two vars are created:</p>
  
  <pre><code>private static View oGoogleGamesView ;
  private static RelativeLayout oViewGroup ;
  </code></pre>
  
  <p>Then in onCreate:</p>
  
  <pre><code>oViewGroup = new RelativeLayout ( this ) ;
  setContentView ( oViewGroup ) ;
  
  LayoutInflater inflater = (LayoutInflater)this.getSystemService ( Context.LAYOUT_INFLATER_SERVICE ) ;       
  oGoogleGamesView        = inflater.inflate ( R.layout.ggmain, oViewGroup, false ) ;
  </code></pre>
  
  <p>And then I try to show the fragment:</p>
  
  <pre><code>// create fragments
  mMainMenuFragment = new MainMenuFragment();
  
  // listen to fragment events
  mMainMenuFragment.setListener(this);
  
  // add initial fragment (welcome fragment)
  getSupportFragmentManager().beginTransaction().add(R.id.fragment_container,
          mMainMenuFragment).commit();
  </code></pre>
  
  <p>And here it crashes with the error at top. Here is the xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/fragment_container"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p><strong>What can I do to show the fragment without crashing?</strong></p>