java - Proper way to chain 2 async tasks in android -


i have 2 async tasks, namely task 1 , task 2.

i need run task 1 first , task 2 after not want couple 2 calling task 2 in onpostexecute implementation of task 1; because use task 1 stand alone in other circumstances.

i there way have 2 async tasks defined without being bounded each other , chain them in specific circumstances?

thank help.

you can try this:

final executor directexecutor = new executor() {   public void execute(runnable r) {     r.run();   } }; asynctask.execute(new runnable() {   task1.executeonexecutor(directexecutor, params1);   task2.executeonexecutor(directexecutor, params2); }); 

i don't have android sdk on machine now, can't verify it.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -