"Android Source design mode"--template Method mode

Source: Internet
Author: User

NO1:

The template method pattern includes : abstract class (which defines a series of sequential methods), implementation Class A, concrete implementation class B

If a subclass has implemented different details, overriding a method of the parent class can

No2:

The asynctask object invokes the Execute method and then executes OnPreExecute, Doinbackground, OnPostExecute, or onprogressupdate in turn.

You need to recreate an object every time you use Asynctask

No3:

The Execute method internally encapsulates the logic flow of OnPreExecute, Doinbackground, OnPostExecute, and the user can repeat these methods according to their own needs. Allows users to easily use asynchronous tasks to complete time-consuming operations and update the UI, which is actually through the thread pool to perform time-consuming tasks, after the results, through the handler to pass the results to the UI thread to execute

No4:

When the Android system starts, the first process that starts up is the zygote process, which is then started by Zygote Systemserver, and then starts Activitymanagerservice, Windowmanagerservice and other system core services that carry the burden of interacting with the client program throughout the Android system.

NO5:

A simple summary of Setcontentview 's basic process is the following steps:

1) Building the Mdecor object, Mdecor is the top-level view of the entire window, it mainly contains the Titile and content view two areas, the title area is our title bar, the content view area is to display the contents of the XML layout area

2) Set some properties about the window, initialize the title bar area and the content display area

NO6:

When activity starts , the OnCreate function allows the user to set up their own interface, and the system adds the layout interface to the content area of a built-in layout interface, at which point the Decorview is established, and then the OnStart function is called and adds Decorview to WindowManager before the function Onresume function, and sets the activity to be visible, then notifies activitymanagerservice that activity has become a resume state, Allows the system to render a view of the activity, so that the activity view is displayed on the phone.

"Android Source design mode"--template Method mode

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.