-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Catch changes to the ListAdapter's data sets
Despite the CursorAdapter documentation, onContentChanged doesn't appear to have any requery logic by default. And CursorTreeAdapter doesn't offer to do any such action, or provide an interface of the same kind as onContentChanged. So simply replace the adapter whenever the dataset changes. This keeps the cursor refresh off the UI thread and lets the progress spinner appear when refreshing. This is closer to the current recommendation in Cursor.requery()'s documentation, which is to instead recreate the Cursor in a background thread. Note that we can't replace the SimpleCursor*Adapter's Cursor here as that will trigger the DataSetObserver again, leading to an infinite loop.
- Loading branch information
Showing
2 changed files
with
73 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters