What's the proper way to wait for a process to complete?
In my main activity, I call class1 setupvariables which returns only a boolean value
In class1 setupvariables I call an httpjob (via httputils2service) which needs to complete in jobdone before returning the setupvariables boolean to the main activity
setupvariables is processing and returning false every time, because it finishes before the jobdone.
I set a "WaitingForJob" boolean as true in setupvariables before the httpjob is called
I set "WaitingForJob" to false in the jobdone.
What is the best way for setupvariables to not return a value until waitingforjob = false?
I set timers, but the code does not wait for them. Do Until waitingforjob = false seems inefficient as it could take a while and causes the app to crash.
Thanks. This forum has been fantastic!
In my main activity, I call class1 setupvariables which returns only a boolean value
In class1 setupvariables I call an httpjob (via httputils2service) which needs to complete in jobdone before returning the setupvariables boolean to the main activity
setupvariables is processing and returning false every time, because it finishes before the jobdone.
I set a "WaitingForJob" boolean as true in setupvariables before the httpjob is called
I set "WaitingForJob" to false in the jobdone.
What is the best way for setupvariables to not return a value until waitingforjob = false?
I set timers, but the code does not wait for them. Do Until waitingforjob = false seems inefficient as it could take a while and causes the app to crash.
Thanks. This forum has been fantastic!