title: findFragmentById return null
body: <p>When I call <code>findFragmentById()</code> with the id of my fragment, it returns <code>null</code>.</p>
  <p><strong>activity_main.xml</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:orientation=&quot;vertical&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;fill_parent&quot;&gt;
  
          &lt;fragment android:name=&quot;com.madduck.test.app.fragment.MainFragment&quot;
                    android:id=&quot;@+id/main_fragment&quot;
                    android:layout_width=&quot;match_parent&quot;
                    android:layout_height=&quot;match_parent&quot; /&gt;
  
          &lt;fragment android:name=&quot;com.madduck.test.app.fragment.LoginFragment&quot;
                    android:id=&quot;@+id/login_fragment&quot;
                    android:layout_width=&quot;match_parent&quot;
                    android:layout_height=&quot;match_parent&quot; /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  <p><strong>MainActivity.java</strong></p>
  <pre><code>private static final int LOGIN = 0;
  private static final int MAIN = 1;
  private static final int FRAGMENT_COUNT = MAIN +1;
  private Fragment[] fragments = new Fragment[FRAGMENT_COUNT]
  
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      FragmentManager fm = getSupportFragmentManager();
      fragments[LOGIN] = fm.findFragmentById(R.id.login_fragment);
      fragments[MAIN] = fm.findFragmentById(R.id.main_fragment);
  
      FragmentTransaction transaction = fm.beginTransaction();
      for (Fragment f : fragments) {
          if (f != null)
              transaction.hide(f);
          else
              Log.e(TAG, &quot;???&quot;);
      }
  
      transaction.commit();
  }
  </code></pre>
  <p>The thing is that when I call <code>fm.findFragmentById(R.id.login_fragment);</code> I get a <code>null</code> but when I call <code>fm.findFragmentById(R.id.main_fragment);</code> I get the fragment.</p>