If the device goes into sleep mode, your work is called onPause() . If you do not cancel or complete a background job in some bizarre way, nothing happens to him. AsyncTask run on a separate thread than the application's main application, so nothing can stop them. Someday.
I did not understand your design: what is the purpose of two separate AsyncTask s? If the data collection for the HTTP-request fill consumes time, you should use one AsyncTask and do everything inside doInBackground() , so that there was no race conditions. Otherwise, you have to perform tasks or execute a chain of a second in the first, and it does not sound right.
HTTP-client - it's just a library of sockets is not a mythological beast :)
source share