should you create new Async Tasks for every different call or use the same one

前端 未结 4 833
[愿得一人]
[愿得一人] 2020-12-18 12:44

So I have an app that will make multipe HTTP Post/Gets

E.G. Login, getThisData, getThatData, sendThis, sendThat

Is it better to have a seperate AsyncTask to

4条回答
  •  执念已碎
    2020-12-18 13:13

    It depends on whether the tasks are independent on each other or whether they are interrelated. If independent you can handle this through the same async. For ex if you need some data from your login response and pass that value to getthis task you better use separate async. Make login a separate async, getthis ,get lthat sendthis sendthat can be in one async.

提交回复
热议问题