1

I am reading google doc and I found these lines, But I am unable to understand the difference between these two statements Why asynctask precessing is direct and loader processing indirect?

Reference

There are several ways to do background processing in Android. Two of those ways are:

  1. You can do background processing directly, using the AsyncTask class.
  2. You can do background processing indirectly, using the Loader framework and then the AsyncTaskLoader class.
Abhishek Bhardwaj
  • 1,164
  • 3
  • 14
  • 39

1 Answers1

4

The AsyncTaskLoader add a level of abstraction that handles some configuration changes.

When the reference say directly it means that you have to handle all configuration changes by yourself because you are using explicitly a Task. If you use a Loader instead you don't have to manage these cases, because it's doing some stuff for you, so it indirectly handles the background processing and you don't have to worry about configuration changes (e.g. a rotation during a network call).

Just read this thread for more information about the differences between the two:

AsyncLoader vs AsyncTask

Hope this helps.

Cheers.

TomD88
  • 721
  • 6
  • 11