1
I have two calls (Call) from Retrofit 2, one that downloads a Config object, and one that downloads a list of Entries.
I need to know when those two calls are finished, so I can call a new one activity
, however, I put two variables of the type boolean
in the onResponse
of each of the two calls to perform a test as:
if(var1 && var2 == true){
//Código para abrir a nova activity
}
When the code reaches the test, the calls have not yet received the response from the server, making the two variables false
, and not starting to Activity
. How can I make that code open the new activity
run only after both calls are completed?