title: Yet another findFragmentById returns null
body: <p>I need to get a fragment (ListFragment), but the code below returns null. Edit: I should add that I'm using a ViewPager together with FragmentStatePagerAdapter.</p>
  
  <pre><code>TaskListFragment tlf = (TaskListFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_task_list);
  </code></pre>
  
  <p>I'm guessing this is because the id is the id of the RelativeLayout in the XML file that makes up the Fragment. </p>
  
  <p>I found a <em>"Fragment"</em> tag, figuring that should enable me to give the fragment an id, but including that tag in the XML file gives me a <em>"Error inflating class fragment"</em> error, even when eclipse shows the XML is valid.</p>
  
  <p>What do I do? Is the problem that the id is wrong? If so, how do I give the fragment an id that can be retrieved using findFragmentById??</p>
  
  <p>Edit: XML added</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/fragment_task_list"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical" &gt;
  
  &lt;ListView
      android:id="@android:id/list"
      android:layout_width="match_parent"
      android:layout_height="match_parent" /&gt;
  
  &lt;TextView
      android:id="@android:id/empty"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:gravity="center"
      android:text="no data" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>