Solved: Suspending threads while running multiple AsyncTasks in nested fragments and it makes app slow Solved: Suspending threads while running multiple AsyncTasks in nested fragments and it makes app slow multithreading multithreading

Solved: Suspending threads while running multiple AsyncTasks in nested fragments and it makes app slow


I know I'm late but as I saw your lots of questions regarding of processing of app I found no error in anything but still I wanna say please check if you're calling any TypeFace by creating a new object each time so comment them and run your code and let me know.

I've also faced this type of issue a long time ago just beacuse of TypeFace so please give a try to my answer and let me know.

Thanks.


Firstly i would recommend you to use any network library can be volley or retrofit. As they are more efficient and they will handle the call in background and parallely without using AsyncTask.

The way you are trying is most sophisticated, as are you calling concurrently.

If it's required, then only make network call on resume. Rest you can call it in onCreateView. Or you can even choose to call it in on start.


Don't do heavy operation within activities or fragments, or every time you modify the user interface you will have to manage problems (with async task too).

You can use asynch task or library such as volley, but with services. A good tutorial is here.