I have an API in one bank that uses AsyncTask to do some work in the background. I need to wait until the result is returned, and then do another wok with this result.
I return to one class in the onPostExecute () method, and then the result is processed in the user interface thread, but the handler should be defined as a callback in another project as a whole, so I cannot just do the work in onPostExecute.
In the second project, I need to wait for AsyncTask to complete. And for the response to be processed, I need to display the results of the TextView handler in action in the second project.
Thread.sleep and using CountDownLatch do not work because processing is done in the user interface thread. Is there any way to do this?
source share