Realice múltiples solicitudes HTTP con Loader

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.

preguntado el 24 de agosto de 12 a las 10:08

¿Por qué no usar un AsyncTask and simply create a new task for each new requests? -

It's every where that loaders are more efficient than AsyncTask. So in order to learn loaders I was trying to modify my project. -

AsyncTaskLoader mostly deal with Fragments and also have several dis-advantages. -

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. -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.