Loading process for Android view

Source: Internet
Author: User

What is activity?

Activity is a visual interface for user operations, and it provides a window for users to place views and interact with each other. It is provided using Setcontentview method. Therefore, you can understand the activity, Window, view three relationships. The activity provides a window and the view is added to the window.

Example of a brush wall:

Activity can be understood as the room, window is the walls of the room, we can brush a variety of different patterns on the wall, these patterns are view.

Loading process for Activity view

1, the activity at the beginning of the creation, called the Attach method, this time, for the activity created a phonewindow, and for Phonewindow set up the return of event interaction.

2, immediately after the activity of the OnCreate () method is returned. Here it is, too. We often replicate the method, we call Setcontentview (ID) in OnCreate ().

3. In Setcontentview (), Phonewindow creates a subclass of the top-level view Decorview (Framelayout).

4, immediately, Decorview will be based on some feature (similar to No_acticon_bar) to add a layout. This layout contains the title, content. The content is also framelayout, which is the parent container in which we add the view in Setcontentview (ID).

So we have to set the implementation to full screen before Setcontentview

GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN,  WindowManager.LayoutParams.FLAG_ fullscreen);
Implement a untitled bar (but with the system's own taskbar):

Loading process for Android view

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.