Android window simply learns to organize a

Source: Internet
Author: User


Relationship between Activity, Window, and View
The Android graphical user interface (graphical user Interface, referred to as GUI), follows the general rules of the Gwes (Graphics window Event System) and manages a system of user input (event management) and System screen output (window and interface Drawing).
In Android development, if you want to display an interface, you will first write a activtiy subclass, so it is understood that activity is an interface, which is quite broad. The system is responsible for creating the activity subclass written by the developer, activity creation is creating a Window object (usually Phonewindow), and a View object (Decorview) is added when the window is created. So the relationship between the three is activity---Window---View, the following is a brief description of the three main responsibilities (see the official 3 categories of related documents):
Activity: The app shows the boss of an interface and is not responsible for screen display, primarily for interacting with Android systems. window: is responsible for displaying the layout (multiple windows are displayed at the top and bottom levels, or on the upper and lower sides), display levels, event handling. View: is responsible for controlling how the specific view area and the event handling within the view area are drawn.

Second, Window System
The Windows management of Android is Client/server (c/s) mode.
Clientactivity opens a session (opens the Iwindowsession Aidl interface) and joins the window to the WindowManager via this interface
Server adds the window child to the WindowManager
Windowmanagerserviceandroid window issues to consider when designing:
Management of Window Z-order order (how Windows overlay)
Calculation of the active window and notification of its change
Window attribution (which app belongs to)
Input Method Management



Iii. window type and Hierarchy
Windowmanagerservice-Iwindow <-viewroot (View variable, token for IPC communication)
Window type, the larger the int value, the higher the display
Window type How to create Range of values
application window Activity internal Complete Creation 1 ~ 99
child window Created by parent window 1000 ~ 1999
System window System judgment shows only one layer 2000 ~ 2999


Reference: Android Core Analysis (-----) Basic architecture Principles of Windows Management for Android Gews

Android Core Analytics (-----Android gwes android window management

Anatomy of the Android Kernel Chapter 8th New Year's Day the process of creating a window chapter 14th Windowmanagerservice Working principle

Android window simply learns to organize a

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.