| Start | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Basic AsyncTaskLoader
Here some basic implementation: Typically In this example, when loader completed, toast with result will be shown. |
||||||||||||
| AsyncTaskLoader with cache It's a good practice to cache loaded result to avoid multiple loading of same data. Remark: Javadocs says about takeContentChanged(): Take the current flag indicating whether the loader's content had changed while it was stopped. If it had, true is returned and the flag is cleared. |
||||||||||||
| Reloading To invalidate your old data and restart existing loader you can use |
||||||||||||
| Pass parameters using a Bundle You can pass parameters by Bundle: Get the value in onCreateLoader: Parameters
RemarksIntroduced in Android 3.0, loaders make it easy to asynchronously load data in an activity or fragment. Loaders have these characteristics:
When not to use Loaders |
Read Article
https://develop.horje.com/learn/1434/reference