Reputation: 6973
I am writing my handlers in two different activities which are running on the same UI thread. Now the question is if I post a message using these two different handlers, would it end up in the same message queue associated with the main thread or each handler has a separate message queue associated with it.
Any pointers will be appreciated.
Upvotes: 0
Views: 1212
Reputation: 28697
Each Handler
is associated with a Looper
. A Looper is in turn associated with a Thread
.
So if you have a single thread, you'll have a single message queue.
Check this link for a nice introduction to Loopers & Handlers.
Upvotes: 1