
And Dialog creates a Window object to manage the window through PolicyManager.makeNewWindow(mContext). For example, PopupWindow is a window, but analyzing its source code can know that this class does not create any Window objects. The window described by Window should be a subset of the general-purpose window. It can be seen that the window described by Window is only based on the general-purpose window, and then an abstract layer to unify the windows that conform to a certain standard. The Window class separates some interactions from the View/ViewGroup, defines some window behaviors, such as menus, and handles system buttons, such as "Home", "Back" and so on. For WmS, the so-called window is a View added through WindowManagerGlobal.addView() (2) The Window class is an abstraction for window interaction, that is, for WmS, all user messages are directly delivered to View/ViewGroup to handle. (1) In the eyes of WmS, the window can be used to display the View. So here the window is divided into two concepts: The following is the relationship between these classes: View itself cannot receive messages directly from WmS, but through the ViewRootImpl.W class that implements the IWindow interface. WmS is responsible for managing the Z-order, display area of these Views, and dispatching messages to the corresponding Views. But for WmS, a window is actually a View class, not a Window class. We know that WindowManagerService (hereinafter referred to as WmS) manages all windows. In fact, the concept of a window has different meanings from different perspectives. What is the relationship between these windows and the Window class, or do windows describe the same concept as the Window class? Like Dialog, ContextMenu, and OptionMenu, these are all windows. The main interface of mobile QQ is naturally a window, and PopupWindow that pops up is also a window. As shown in the figure below, the status bar above is a window. However, in the frame design of Android, what exactly is a window? What is the relationship between a window and the Window class in the Android Framework? Take the main interface of mobile QQ as an example. In the development process, we often encounter various classes or methods related to windows.
