I post this question because i wanna know if my thoughts are right about the basics.
What should be clear is that the UI-Thread contains a MessageQueue
, which is associated with a Looper
to get messages/runnables out of the queue for processing.
Furthermore a Handler
sends messages/runnables to the Looper
, which integrates the object in the MessageQueue
.
If im right the MessageQueue
is the stack and the Looper
is the caretaker of the incoming and outgoing objects.
This leads to my next question. If a message object is processed by the UI-Thread, it will be recycled to the global message pool. But theres no explicit documentation about this. Is there a specific size for this message pool? Is it expandable/shrinkable if i send/obtain messages?
If this would be true the pool could dry out by obtaining to many messages. And i cant believe this. Think about a situation where you have to obtain some messages without sending them back for recycling in a specific time period.
Edited to make it more understandable.