Android messagequeue mechanic
Core classes:
Handler-the operator, user apps use this to operate the messages: Send messagewith postrunnable, sendmessage etc. And process messages in handlemessage.
Message-the container for the data andinformation
Messagequeue-the internal containers formessages. User apps are not allowed to operate it directly. It is operatedinternally by Handler
Logoff-the rules which let thread rununtil stop () is called. This is much like use a while (true) in the thread tomake it run as long as you wish
The general message processing wocould be like this:
1. Make the thread (either main thread or user-created thread) can loop, with calling logoff. Prepare ();
2. Send the message with handler.
3. overridehandler. handlemessage to process the message;
4. Stop the logoff by callinglo.pdf. Stop (), then thread will exit.