Andrew
Andrew

Reputation: 21076

Updating CursorAdapters

When my Activity resumes, I query for a Cursor (by calling managedQuery to retrieve a Cursor pointing at my database using a ContentProvider), call startManagingCursor, instantiate a new CursorAdapter, and setListAdapter to my new CursorAdapter.

Suppose, at some later point, I launch some thread that hits a web service to query for new data to add to that table. Do I need to repeat everything I've listed above again?

This is what I'm currently doing, but I'm wondering if there isn't a more efficient way of doing it.

Upvotes: 0

Views: 182

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006594

Suppose, at some later point, I launch some thread that hits a web service to query for new data to add to that table. Do I need to repeat everything I've listed above again?

No, just call requery() on the Cursor.

Upvotes: 2

Related Questions