========================= Sixth Chapter =========================
The life cycle of an application:
The main factors that determine the life cycle of an Android system include:
1. How much memory is currently available on the system-when memory is low, kill some processes to free up memory
2. The importance of the process to the user--priority to kill processes that are not important to the user
1. Foreground process---run in the foreground, can interact directly with the user process
2. Visible process---User visible, temporarily obscured, temporarily unable to interact with the user process
3. Service process---the process in the background started the service
4. Background process---to not start the service, just click the Home button, keep the process in the background
5. Empty process-----The user clicks the return key and exits the process
Processes that are kept in memory are divided into the above process types. The degree of importance decreases in turn. When the system memory is low, the priority is to kill the empty process.
Life cycle of activity:
7 Events---------------7 methods-------------------four states
Create---------------onCreate ()------------< creating the activity>
Start----------------OnStart ()--------------< start the activity>
Resume---------------onresume ()-----------Enter the active state
Restart--------------Onrestart ()------------< restart the activity>
Pause----------------OnPause ()------------into a paused state
Stop-----------------onStop ()-------------Enter the stopped state
Destory--------------ondestory ()----------End state
Use the log class to print:
LOG.V (String tag,string text);------Verbose level
LOG.D (String tag,string text);------Debug Level
LOG.I (String tag,string text);------Info level
LOG.W (String tag,string text);------Warn level
LOG.E (String tag,string text);------Error Level
Only log logs below a certain level can be filtered.
Sixth life cycle of Android apps