title: Can't find Fragments in onCreate
body: <p>I admit I am still struggling with Fragments and currently I don't know where to load what:</p>
  
  <p>At first I loaded my Fragment in OnCreate() of my Activity, but then I had difficulty to access it (via findViewById) and moved it to onStart(), but I can't still find the Views within the Fragments on onStart()...</p>
  
  <p>So in onCreate:</p>
  
  <pre><code>setContentView(R.layout.myfrag);
  FrameLayout fl = (FrameLayout)findViewById(R.id.iPortraitView);  // different for Landscape
  if(fl.getChildCount() == 0)  {
       getFragmentManager().beginTransaction()
      .add(R.id.iTestView, new AFragmentClass).commit();
  }
  else {
       getFragmentManager().beginTransaction()
      .replace(R.id.iTestView, new AFragmentClass).commit();
  }
  Log.d("myTest", String.valueOf(fl.getChildCount()));
  </code></pre>
  
  <p>Now the problem is that <em>fl.getChildCount()</em> always returns 0 in onCreate, thereby adding new Fragments, while actually there is something in there and when I call the same code (<em>fl.getchildCount()</em> ) in onCreate, I get the correct count (which obviously increases each time I change the orientation). And as a result I have overlapping Views from both my landscape and portrait layouts.</p>
  
  <p>I'm a a loss here and guess I'm struggling with figuring out what to load when (and especially when I can access them). Furthermore, do I have to implement all Listeners for <em>potential</em> Views (like Buttons contained in the various Fragments) that I might load dynamically in my Fragments?</p>