How does the handler message queue work? I know for a fact that the message queue is tied to the thread it is initialized in. If i have 2 tasks(each download from the web), and I initiate an async task from the handler,one for each, will the 2 tasks be executed simultaneously?
I just need to understand, how the queue works..
could anyone please help! 🙂
First of all,
AsyncTaskcan be executed only on the UI thread. So, even if you have two separate handlers (one for eachAsyncTask) they should be both associated with the UI thread.Secondary, several
AsyncTaskinstances may run either simultaneously or one by one. It depends on the API version. It is better to read documentation about this: