Android window three create an app windows

Source: Internet
Author: User



Create an app window one, create a Activity1. The application window must correspond to the ACTIVITY,AMS notification client Activitythread start activity. Reflection Create Activity Object
Second, create Window2. The Activity.attach () method sets the internal variable. 3. The Activity.attach () method creates a Window object. Policymanager.makenewwindow () Create (via Com.android.internal.policy.impl.Policy configuration) Create Phonewondow, assign to Activity.mwindow settings Setcallback () [ The Calback of window is the current activity, which is why the user message can be passed to the activity for the reason]4. The Window.mwindowmanager is assigned a value. WindowManager is an interface, two implementation class Window.localwindowmanager (is a shell, its implementation in its internal windowmanagerimpl) and Windowmanagerimpl
Third, create VIEWROOT5. Add a view, call Callactivityoncreate from inside Performlaunchactivity, and eventually call Setcontentview in OnCreate. Setcontentview source Getwidnow.setcontentview () Installdecor () create title bar, etc. 6. Setcontentview source code, analysis theme related Settings 7. When the activity is ready, notify Ams,ams final call to Activity.makevisible () 8. Activity.makevisible () Source Code, window type is type_application. Viewgroup.addview "level" Judge WindowManager level 9. Localwindowmanager.addview (Windowmanagerimpl.addview an app has only one this object), which contains 3 arrays. Complete key additions through Viewroot.setview.
Four, the window added 10. Array mviews, mroots, mparams save view, Viewroot, Windowmanager.layoutparams11.     Perform Viewroot.setview to complete the final window add work. Mattachinfo assignment, Requestlayout issue interface re-layout request Swindowsession.add notify WMS Add window


Resources:

"Android Kernel Anatomy" chapter 8th 8.3 Creating an application window

Graphical android-android GUI System (2)-Window management (View, Canvas, window manager)



android window mechanism analysis------UI Management System (Window level)


Android window three create an app windows

Related Article

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.