Android message mechanism (2)

Source: Internet
Author: User

1. The message queue of Android is like a tunnel. The message is like a vehicle. It is first-in-first-out.

2. The message sending thread does not block the thread, while the message receiving thread blocks the thread. This is the handler mechanism of Android. After handler finishes processing a message object, it will continue to fetch the next message for processing.

3. There is no global messagequeue in Android. Different APK files cannot be communicated through messagequeue.

4. android UI cannot be updated directly by using the Java thread, because Android view is not completely designed by the thread. However, Android provides several methods for developers to update the UI in the thread, as follows:

Activity. runonuithread (runnable)
View. Post (runnable)
View. postdelayed (runnable, long)
Hanlder

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.