NO1:
The enjoy meta-mode is an implementation of an object pool . The enjoy meta-mode is used to minimize memory usage and is suitable for scenarios where there may be a large number of duplicate objects, to cache shareable objects, to achieve object sharing, to avoid the effects of creating too many objects, which can improve performance, avoid memory removal, and so on.
No2:
the UI cannot be updated in a child thread . Because it is not possible for the UI to be updated in a child thread, the UI cannot be updated without its creation line thread.
No3:
(1) First constructs the Java layer's Looper object, and the Looper object creates the Java layer MessageQueue object in the constructor.
(2) The Java layer's MessageQueue constructor calls the Nativeinit function to initialize the nativemessagequeue of the native layer, The Nativemessagequeue constructor also creates a looper of the native layer and sets up a message mechanism through the pipeline and Epoll
(3) The native layer is built, converting the Nativemessagequeue object to an integer stored in the mptr of the Java layer MessageQueue
(4) Start the Java layer's message loop and continuously read and process messages
This initialization process is done in the main function of Activitythread, so after the main function is run, the UI thread message loop is started, and the message loop continuously reads and processes messages from the message queue, making the system work.
No4:
The processing of messages is divided into native layer and Java layer , two levels have their own message mechanism, native layer is based on pipeline and Epoll, while Java layer is a normal linked list.
"Android Source design mode"--Enjoy meta mode