What happens when Activity is paused while it's waiting for data from the Internet?

Viewed 68

What happens if an ActivityA makes a Volley request (ASAIK, Volley request runs not on the UI Thread), and let's say that the volley request ask for a lot of data. Volley request has a callback method named onResponse, that contains the JSON Objected returned as a response, and this method runs on the UI-Thread. inside this method we will parse the object, make ProgressBar visibilty to GONE and add the items into ReyclerView that is part of the ActivityA. While the request is in progress, we are showing a circled progress bar. Now (Before the response was returned) user decided to "leave" temporarily the application (so onPause runs). What will happen when the result from the server arrive? Does trying to update the UI will cause an Exception, or the UI Thread and the ActivityA still alive? If they are alive so what will happen when the user will return to application? Is he still see the progressBar, or the RecycelrView filled with the items from the JSONResponse?

0 Answers
Related