Learn android window module more than a week, feel their understanding of the module is still relatively vague, first get the knowledge points recorded.
Is the learning process recorded Activity window START process sequence diagram, no or no way to complete the picture, the whole process is more complex:
The entire learning process is based on Lao Luo's Android Travel blog and "in-depth understanding of the Android kernel design ideas," a book to assist, thanks to predecessors.
The overall startup process of the activity can be viewed Android4.4 The process of starting an application (StartActivity) in the framework analysis--launcher sequence diagram, this article focuses on the Activity Window Creation Detail section (perhaps not thin enough).
STEP3~STEP13, which is the creation of context contexts,activity itself is the indirect subclass of the context, and the Contextimpl that are created here can be viewed with their relationship to Android and design patterns-decorators (Decorator) mode article. For a detailed analysis of the step3~step13 , it is recommended to look at the creation process analysis of the runtime context of the Android application window (Activity) of Lao Luo, which is written in more detail in this article.
STEP14~STEP16, is the creation of Phonewindow, the Activity window we mentioned in the title is actually this, and all the view is built on this window.
Step19~step22, is the creation process of WindowManager.
STEP24~STEP33, is the creation of the Decorview process, the Decorview will be appended to the Phonewindow.
The invocation of Step40~step42,xxxactivity's Onresume () indicates that the activity is to be displayed.
step47, start adding windows to the WMS.
Step50,viewrootimpl was created.
Step51~step57, the window is associated with the WMS, and the information about the window is recorded in the WMS.
STEP63, we will gradually add our layout in the XML file to the Viewrootimpl .
The following will use Surfaceflinger to correlate surface and the like, this part of the C + + code does not understand, the whole process there are many areas need to deepen understanding, continue to chew code ....
Right-copy the image address and open it in the browser to see a larger image.
Please correct me if there is any wrong place to be continued.
Android4.4 Framework Analysis--activity window creation process (i)