Reputation: 2944
I have a application need to run 2 AsyncTask at the same time.
but one AsyncTask is running something takes a long time, another is sql process.
So I need the following functions.
Is it possible to do like this? what kind of asyncTask should I use? thank you
Upvotes: 0
Views: 284
Reputation: 551
You will need to use a thread pool Executor to execute Asynctask. The default implementation uses a serial executor running on a single thread, you want parallel.
So create a ThreadPoolExeecutor and then use Asynctask's executeonExecutor instead of execute method.
Nandeesh solved it here: running parallel AsyncTask
Upvotes: 2