Realice múltiples solicitudes HTTP con Loader
Frecuentes
Visto 1,341 veces
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.
0 Respuestas
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas android asynchronous or haz tu propia pregunta.
¿Por qué no usar un
AsyncTask
and simply create a new task for each new requests? - userIt's every where that loaders are more efficient than AsyncTask. So in order to learn loaders I was trying to modify my project. - Rookie
AsyncTaskLoader mostly deal with Fragments and also have several dis-advantages. - Lalit Poptani
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
blog.gunawan.me/2011/10/android-asynctaskloader-exception.html..... gist.github.com/2949121 - Rookie