0

Example I have a layout with a list and an image at the top of the list. I have CursorAdapters for both of them that load this data from a service. Since android has one UI thread and all the other background AsyncTasks run on one thread, does that mean whichever one I call first, finishes first?

user2759617
  • 597
  • 1
  • 8
  • 20
  • Take a look at [this](http://stackoverflow.com/questions/4068984/running-multiple-asynctasks-at-the-same-time-not-possible) – Antrromet Jul 28 '15 at 01:23

1 Answers1

2

Yes it does. By default AsyncTasks go to one queue because they use serial executor. If you want them to execute in parallel you should use your own ThreadPoolExecutor instead.

Gennadii Saprykin
  • 4,505
  • 8
  • 31
  • 41
  • 2
    Assuming at least Android 3.0, or before 1.6. Between 1.6 and 2.3 they actually executed on parallel threads by default. Then Google realized too many people can't write multithreaded code. – Gabe Sechan Jul 28 '15 at 01:31