Java – How do I run asynchronous tasks synchronously without post-execution linking?

How do I run asynchronous tasks synchronously without post-execution linking?… here is a solution to the problem.

How do I run asynchronous tasks synchronously without post-execution linking?

I

have three asynchronous tasks and I want to be able to run them synchronously. What do I do if I don’t put them in each other’s onPostExecute? Sorry if this is covered, but I can’t seem to get the right keywords on google or here.

new parseZip().execute();
new loadContent().execute();
new playContent().execute();

Any help would be appreciated, or just a link to a thread

Thanks

Solution

i’d like to be able to run them synchronously. How can I do that
without putting them in onPostExecute of eachother?

Create your own threads for three separate tasks and synchronize them for serial execution. See also here.

See also >Specifying the Code to Run on a Thread Example.

By the way, AsyncTask runs continuously by default. If I were you, I would simply put them in each other’s onPostExecute(). Is there anything wrong with this?

Related Problems and Solutions