title: Android ListView Live Updating
body: <p>I have a ListView in a ListActivity that's bound to some data.  I have a content provider that's providing the data.</p>
  
  <p>The ListActivity gets the data by querying a content resolver:</p>
  
  <pre><code>Uri uri = Uri.parse("content://my.provider.DocumentProvider/mystuff");
  contentCursor = this.getContentResolver().query(uri, null, null, null, null);
  </code></pre>
  
  <p>So now the activity has the cursor.  It creates an adapter and attaches it to the list:</p>
  
  <pre><code>ListAdapter adapter = new DocumentListCursorAdapter(this, R.layout.main_row_layout, contentCursor, new String[] { "titleColumn" }, new int[] { titleColumnIndex  });
  setListAdapter(adapter);
  </code></pre>
  
  <p>This works fine; the list shows the data in the cursor.</p>
  
  <p>But now the content provider has new data.  I want the list to update to show the new data.</p>
  
  <p>The examples I've seen involve a call to the adapter's notifyDataSetChanged, but it seems to me that this breaks the separation between the content provider and the list, which is consuming the content.  </p>
  
  <p>Does the content provider need to know what adapters are attached to the cursor so it can call their notifyDataSetChanged method?  Or is there a better way that doesn't see these two things coupled this way.</p>