Is android async task slow or am i doing something wrong?
Here is what i do
Log.e("Filler", "before");
new DownloadListContent().execute("string");
Log.e("Filler", "after");
and DownloadListContent()..
class DownloadListContent extends AsyncTask<Object, Object, Object> {
protected Void doInBackground(Object... urls) {
Log.e("Filler", "Am in doInBackground");
....
}
And here is the logCat.
03-15 23:18:**47**.598: E/Filler(17150): before
03-15 23:18:**47**.598: E/Filler(17150): after
03-15 23:18:**59**.789: E/Filler(17150): Am in doInBackground
That is 12 seconds before do in background occurs. Why is that happening?
In the mean time i have other instances of other classes of AsyncTask do some other network jobs. Does AsyncTask affects one an other?
I really cannot figure that one out!
UPDATE
Thank you for the comments. seems that async has a hard limit on how many threads will run at the same time. This is a killer if you have to download a bunch of images at the same time with your data.
Following CommonsWare's method here i can seperate the type of asyncTask so that one type (images) don't block other type (list data).