android - Calling Asynctask in a quick succession -


i have application based on gcm sends data phone in quick succession.i receiving through broadcast receiver , action in asynctask according parameters received.

my question suppose -- have called asynctask first time, did not reached doinbackground method , has been called second time first asynctask completed?

it depends on android version. quoting documentation:

order of execution

when first introduced, asynctasks were executed serially on single background thread. starting with donut, changed pool of threads allowing multiple tasks operate in parallel. starting honeycomb, tasks executed on single thread avoid common application errors caused parallel execution.

if want parallel execution, can invoke executeonexecutor(java.util.concurrent.executor, object[]) thread_pool_executor.

https://developer.android.com/reference/android/os/asynctask.html


Comments