title: Populating an Android ListView with multiple data sources (using Loaders)
body: <p>I've three database tables: <code>Stacks</code>, <code>Dates</code> and <code>Z</code>, where <code>Stacks</code> is my main table, and <code>Dates</code> and <code>Z</code> are 'child' tables, with a foreign key column, linking to the primary key column of <code>Stacks</code>. (Forgive my terminology, I can present the schema if needed.)</p>
  
  <p>I will henceforth only refer to <code>Stacks</code> and <code>Dates</code>, to reduce the complexity of my explanation, but in case it is relevant, <code>Z</code> will be used in exactly the same way as <code>Dates</code>.</p>
  
  <p>In a typical <code>ListFragment</code>, I construct a <code>ListView</code> using the implementation discussed on the <code>LoaderManager</code> <a href="http://developer.android.com/reference/android/app/LoaderManager.html" rel="nofollow">reference page</a> - creating an empty adapter, then swapping the <code>Cursor</code> out when my query has finished(query in <code>onCreateLoader()</code> and swap in <code>onLoadFinished()</code>).</p>
  
  <p>I query against the <code>Stacks</code> table (using the URI, as my DB is fronted by a <code>Content Provider</code> implemented using the <code>Simple Content Provider</code> <a href="https://github.com/mitmel/SimpleContentProvider" rel="nofollow">library</a>), as the values I want to bind to each list item in <code>getView()</code> in the adapter, are mostly found here, and this works fine.</p>
  
  <p>However, I also wish to bind some values from the <code>Dates</code> table, though I'm unsure how to do this. Prior to using loaders, I would create a new <code>SQLiteOpenHelper</code> in the adapter, and access the secondary items directly in the getView() method, i.e. return <code>Cursor</code>s from the <code>Dates</code> table. This was slow, and I'm pretty sure it was a bad idea in hindsight :P</p>
  
  <p><strong>Is there a standard way to implement this, filling a list view using multiple sources of data (ideally using Loaders)?</strong></p>
  
  <p>Edit:  </p>
  
  <ul>
  <li>The <code>Dates</code> table may have multiple records (with different values)
  for each associated <code>Stack</code>.</li>
  <li>I have one ContentProvider which provides access to all three tables, depending on URI      </li>
  <li>I'm happy to use multiple loaders also, as I suspect I'll have to do anyway as I need to display other information in the fragment not associated with the content in the <code>ListView</code>.</li>
  </ul>