开发者

Updating CursorAdapters

开发者 https://www.devze.com 2023-01-14 02:57 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消