سؤال

just a quick question (I think this is more of a design question than actually programming) I am looking for a way to do Multiple API calls in an IntentService or a Service giving that the result from one call is being used in another. I thought of having different AsyncTask for each different call but am not if this is an efficient method. Or is it possible to just make the call in the Service without the AsyncTask?.. Any feedback and any other better solution will be greatly appreciated. Thank you.

هل كانت مفيدة؟

المحلول

I think in two diferentes ways, but depends your application, asyntask(you mentioned) or Android asynchttp.

http://loopj.com/android-async-http/

But i repeat, depends your project maybe we need more information to extends the answer.

نصائح أخرى

Now we have rxJava to help us. I had same requirement in one of my project and used rxJava for that. I have created 2 diff observers one was returning some list which I was passing to second one which was fetching details of each item in the list.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top