0

I read the documentation of Loader and it was written that a LoaderManager can have multiple loaders which can be identified through id's . But I have a confusion that if I want to make 5 or 6 HTTP requests asynchronously, how can I use multiple loaders for this. What I'm thinking is every time I want to make a new HTTP request, I'll get a new instance of class that is implementing AsyncTaskLoader. An example would be appreciated.

Rookie
  • 8,660
  • 17
  • 58
  • 91
  • Why not use an `AsyncTask` and simply create a new task for each new requests? – user Aug 24 '12 at 10:07
  • It's every where that loaders are more efficient than AsyncTask. So in order to learn loaders I was trying to modify my project. – Rookie Aug 24 '12 at 10:10
  • [AsyncTaskLoader](http://stackoverflow.com/a/7122836/726863) mostly deal with Fragments and also have several dis-advantages. – Lalit Poptani Aug 24 '12 at 10:45
  • So you mean that we should use AsyncTask instead of AsyncTaskLoader. I had a doubt that if they have introduced loaders, the AsyncTask might be deprecated in future. – Rookie Aug 24 '12 at 10:50
  • http://blog.gunawan.me/2011/10/android-asynctaskloader-exception.html..... https://gist.github.com/2949121 – Rookie Aug 24 '12 at 10:56
  • http://blog.sleepybear.us/2012/02/loading-loading-loading.html – Rookie Aug 24 '12 at 11:04

0 Answers0