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开发者_StackOverflow社区, 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.
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
.
精彩评论