title: ListFragment RuntimeException 'android.R.id.list' missing
body: <p><strong>Edit 1/16/2013:</strong> Problem Resolved!  Two days ago, I released an updated version of the app and <strong>correctly</strong> identified the <code>ListViews</code> as I had originally done, by using <code>android:id="@android:id/list</code>.  Really though, the exception being thrown was misleading and that had nothing to do with the actual problem...</p>
  
  <p>The real fix came when I implemented the suggestions by Sean on inflating the <code>ListFragment</code> views by passing <code>null</code> to the <code>ViewGroup</code>.  I have not received the same Exception from the new version, and the new version has been downloaded by enough devices to safely say this issue is resolved.  However I really appreciate the comments and answer made by Lawrence, and will continue to read about how he is instantiating the Fragments.  While he provided the suggestion of passing null to the View inflater, Sean was actually the first to do so, and since his solution seems to have resolved the issue, the bounty will be awarded accordingly.  I will update this thread in the future if I learn/read more about the different ways of instantiating the Fragments as suggested by Lawrence's excellent answer.  Too bad I can't split the bounty!</p>
  
  <p><strong>Edit 1/14/2013:</strong> <code>ListView</code> related <code>XML</code> files are located at <a href="http://pastebin.com/2xnG1VfF" rel="nofollow">http://pastebin.com/2xnG1VfF</a> per @LawrenceChoy's request</p>
  
  <p><strong>Edit 1/13/2013:</strong>  I released an updated version of my app and used <code>android:id="@+id/android:list</code> instead of <code>android:id="@android:id/list"</code> per Bishan's suggestion, however I am still receiving random exceptions that my Fragment Actvity does not have <code>a ListView whose id attribute is 'android.R.id.list'</code>, even though that activity does not have any <code>ListViews</code>.  Added another exception from LGE phone.</p>
  
  <p><strong>Edit 1/9/2013:</strong> Although Bishan provided an answer, I was hoping for a little more explanation as to why his solution might prevent this exception.  After reading further I believe it is because when using a custom <code>ListView</code>, one should use a + symbol.  However would like to get confirmation I am correct or to get clarification, especially considering both seem to work on many different devices and emulators.  Raising a bounty in about 20 minutes to seek a reputable source/answer on the matter.  Thanks.</p>
  
  <hr>
  
  <p>I'm getting some very odd behavior from a few devices out in the wild after a recent updated release to the play store.</p>
  
  <p>In my new release I have a <code>FragmentActivity</code> (called TabsStyled) that uses a <code>FragmentStatePagerAdapter</code> to manage several fragments.  I have a total of 4 fragments, and 2 of those fragments extend <code>ListFragment</code> and have listviews populated by <code>LoaderManager</code> and <code>CursorLoader</code>, all from <code>support.v4</code> libraries.  The other two fragments do not have <code>ListViews</code> and do not extend <code>ListFragment</code>.</p>
  
  <p>I did extensive testing on multiple devices as well as AVDs and never encountered any RuntimeExceptions for missing android.R.id.list.</p>
  
  <p>However, upon release, a few ACRA crashes showed up for the FragmentAcitivty <code>"Your content must have a ListView whose id attribute is 'android.R.id.list'"</code>.  TabsStyled.class is the <code>FragmentActivity</code> that manages the ListFragments and itself does not have any `ListViews'.   This seems very strange to me, since I would think that if this exception were to be thrown, it should be for one of the ListFragments, and not the "parent" FragmentActivity.</p>
  
  <p>Here's the top of the stack trace, and I'm happy to provide any additional code or info as requested rather than paste everything here.</p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.hiddenforsecurity/com.myapp.hiddenforsecurity.TabsStyled}: 
  java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
  </code></pre>
  
  <p>A full stack trace available on pastebin here: <a href="http://pastebin.com/aiV7pwXP" rel="nofollow">http://pastebin.com/aiV7pwXP</a>.</p>
  
  <p>The XML for each of the <code>ListFragments</code> which contain the ListViews (a separate <code>ListView</code> in a separate XML for each <code>ListFragment</code>):</p>
  
  <pre><code>&lt;ListView android:id="@android:id/list" 
      &lt;!--the release currently uses "@+id/android:list)--&gt;
      android:layout_width="fill_parent" 
      android:layout_height="0dip" 
      android:layout_weight="45" /&gt;
  </code></pre>
  
  <p>One of the <code>ListFragments</code> (slightly simplified to make this easier to diagnose) uploaded to pastebin (the other ListFragment is very similar): <a href="http://pastebin.com/Nts3nVx1" rel="nofollow">http://pastebin.com/Nts3nVx1</a></p>
  
  <p>And a slightly simplified full version of TabsStyled (<code>FragmentActivity</code>): <a href="http://pastebin.com/ZS4Xg8kP" rel="nofollow">http://pastebin.com/ZS4Xg8kP</a></p>
  
  <p>The devices that created the exceptions thus far (and as of 1/14 they continue to post crashes):</p>
  
  <pre><code>MODEL       BRAND    ANDROID API
  GT-I9305    Samsung  4.1.1 (using @android:id/list)
  GT-S7562    Samsung  4.0.4 (using @android:id/list)
  GalaxyNexus Samsung  4.2.1 (same exception seen with @+id/android:list)
  L-01E       LGE      4.0.4 (same exception seen with @+id/android:list)
  </code></pre>