Free Android app covering all aspects of addiction, including prevention and treatment

Using a Loader to get your data out of a database

So what’s a Loader?

loader iconWell, it's the next best thing since sliced bread! This is what they can do for you:

  • You can use loaders in activities and fragments
  • Loaders have been available since Honeycomb (API level 11) and also since Donut (API level 4) if you use the support library
  • Loaders can be used to load any kind of data from any data source (for example, Arrays and Databases)
  • Loaders work on a separate thread so your app carries on working while the Loader gets the data
  • Loaders monitor the data source for any changes and updates the data it gives you
  • Loaders take care of restoring the cursor after a configuration change without having to do a re-query