title: reason to check for savedinstancestate on frgamentActivity oncreate()
body: <p>I'ms studying fragments and I checked the tutorial in the docs <a href="http://developer.android.com/guide/components/fragments.html" rel="nofollow">here</a> with the articles master details example. We have 2 fragments one for article titles and when selected the detailed article view appears (Multi-pane layout). I get most of the tutorial except one small part, why they check the savedInstancestate inside the onCreate method.</p>
  
  <p>so my question is about the onCreate() method of the container activity. It has this check </p>
  
  <pre><code> if (savedInstanceState != null) {
                  return;
              }
  </code></pre>
  
  <p>When I remove this, the fragments are overlapped in the ui. so I know it prevents this but I don't know why ? I want some one explain this to me.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Edit: The full Method </p>
  
  <pre><code> public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.news_articles);
  
      // Check whether the activity is using the layout version with
      // the fragment_container FrameLayout. If so, we must add the first fragment
      if (findViewById(R.id.fragment_container) != null) {
  
          // However, if we're being restored from a previous state,
          // then we don't need to do anything and should return or else
          // we could end up with overlapping fragments.
          if (savedInstanceState != null) {
              return;
          }
  
          // Create an instance of ExampleFragment
          HeadlinesFragment firstFragment = new HeadlinesFragment();
  
          // In case this activity was started with special instructions from an Intent,
          // pass the Intent's extras to the fragment as arguments
          firstFragment.setArguments(getIntent().getExtras());
  
          // Add the fragment to the 'fragment_container' FrameLayout
          getSupportFragmentManager().beginTransaction()
                  .add(R.id.fragment_container, firstFragment).commit();
      }
  }
  </code></pre>