Open fefe982 opened 8 years ago
If you always want your background task to run parallel to the BabayagaTask, just use:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
yourTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
} else {
yourTask.execute(params);
}
If your minSdkVersion
is 11+, you don't need the else-block.
BabayagaTask is started with AsyncTask.execute().
Sometime, when the network condition is not good, the connect operation can take quite a lot of time. This stalls other background task on some versions of android.
On some versions of android (and the most recent versions of android), AsyncTask.execute() will only use one background task. This makes all other background task wait for it to finish.
The android document for AsyncTask.execute() says:
Any workaround for this?