Five life cycle learning for Android processes

Source: Internet
Author: User
<span id="Label3"></p><p><p>The life cycle of the learning process in this section:</p></p><p><p>The Android system protects every process as much as possible, but eventually it needs to release the old process for new processes, or important processes. In order to decide which process was protected, the one was Killed. The android system kills that process based on the state of the components in the current process and the components that are running in progress to decide to keep that. of course, when the system resources are scarce, the process level is first killed, and so On.</p></p><p><p>There are five types of process levels in the Android System:</p></p><p><p>1: foreground process (foreground process has five states, only one of the content is the foreground process, the foreground process is very difficult to Kill)</p></p><p><p>A: A process that has an activity that is interacting with the user (when the Activity's onresume method is Called)</p></p><p><p>B: A service that binds an activity that is interacting with the user</p></p><p><p>C: have a "running in the foreground" service, that is, the startforeground of the service is called</p></p><p><p>D: Have a service that is executing one of the service life cycle functions (onCreate (), onStart (), or OnDestroy ())</p></p><p><p>E: has a broadcast recipient who is executing the Onreceiver method</p></p><p><p><br></p></p><p><p>2: visible Process (visible process has two states, as long as one satisfies the foreground process)</p></p><p><p>A: Has an activity, but the activity is not in the foreground, but the user can see the process of the activity (activity's OnPause method Call)</p></p><p><p>B: A service that binds a foreground or visible activity</p></p><p><p><br></p></p><p><p>3: Service Process</p></p><p><p>A process that has a service initiated through StartServer</p></p><p><p>Although the service user is invisible, but the service process can do something very important (such as playing music in the background, downloading things), the service process is generally impossible to Kill. The service process is killed unless the system has insufficient resources. however, when the system resources are sufficient, the system will automatically start the killed service Process.</p></p><p><p><br></p></p><p><p>4: background Process:</p></p><p><p>A process that has a user invisible activity, at which time the OnStop method of the activity is called</p></p><p><p><br></p></p><p><p>5: Empty Process:</p></p><p><p>Processes that do not have any active app components</p></p><p><p>An empty process can easily be killed.<br></p></p><p><p><br></p></p> <p style="font-size:12px;"><p style="font-size:12px;">Copyright Notice: This article for Bo Master original article, without Bo Master permission not Reproduced.</p></p> <p><p>Five life cycle learning for Android processes</p></p></span>

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.