title: How do I place fragments to the default root ViewGroup of an Activity?
body: <p>According to the android developer guide,</p>
  
  <blockquote>
    <p>To get started, your layout must include a ViewGroup in which you
    place each Fragment associated with a tab. Be sure the ViewGroup has a
    resource ID so you can reference it from your tab-swapping code.
    Alternatively, if the tab content will fill the activity layout
    (excluding the action bar), then your activity doesn't need a layout
    at all (you don't even need to call setContentView()). Instead, you
    can place each fragment in the default root ViewGroup, which you can
    refer to with the android.R.id.content ID (you can see this ID used in
    the sample code below, during fragment transactions).</p>
  </blockquote>
  
  <p>But without the <code>setContentView()</code>, whenever I call <code>getActionBar()</code>, it returns null. I am wondering how would I place fragment in the <code>default root ViewGroup</code>? Do I add it through XML or programmatically?</p>