Shared publicly  - 
 
The newest post on my blog is about using the Loader-API on Android. 

Since the Loader-API offers only an implementation for ContentProviders, I also briefly cover Mark Murphy's Loader library that adds an SQLiteCursorLoader.
With the introduction of Honeycomb Loaders became the preferred way to access data of databases or content providers. They load data asynchronously and notify listeners when the results are ready.
13
6
Davide Corradini's profile photoBalesabu Godugu's profile photogeorge oloo's profile photoJoshwin Greene's profile photo
4 comments
 
I'm not very familiar with the loader API (had no time yet), do they provide significant advantages over AsyncQueryHandlers?
 
+Florian Herbel Yes, because they are event-driven, auto-updating, and can be automatically managed across the Activity/Fragment lifecycle by the LoaderManager :)
 
+Florian Herbel They keep track of the lifecycle. Like startmanagingCursor() does - but in a user-friendly way.
Also they keep track of changes to the underlying datastore.
For loading I would use Loader, but for updating/inserting or deleting the AsyncQueryHandler is nevertheless useful.
 
+Wolfram Rittmeyer Do the Loaders provide some kind of "defered requery" behavior? E.g. when my activity is paused and there are changes on the content-uri, do the loaders trigger a requery (or query for a new cursor) when the activity is resumed?
Add a comment...