Expectation of AsyncTask without blocking the main UI flow
We need to wait for AsyncTask to complete without locking the main flow to make it impossible to get out of Activity by firing Back.
How do we do that?
Get yourself a flag like this.
boolean♪ that keeps quiet ♪
AsyncTaskPut it in the true, and redesign it.
ActivitySo long as the flag
!= trueDon't do anything.