Here is a simplified version of my code. function1()
has to check something on the internet. It has to do it in the background of the app(I cannot change that), which allows the rest of the code to run while it checks the internet. This function can take several seconds to complete. I cannot put the log at the end of function 1 because it needs to run whether function1 is successful or not, but only after it is done trying. How can I achieve this without using a timer?
if (condition) {
if (condition2) {
function1();
}
Log.i("Info", "This should not appear until function1 completes or fails");
}