Learning content: Activity life cycle and Logcat use
====activity life cycle = = = =
Illustrated (reproduced):
Normally starting an activity to terminate the operation, the main function call process is as follows:
OnCreate
OnStart
Onresume
OnPause
OnStop
OnDestroy
If you encounter a program running, suddenly have high priority other programs need to run, such as pressed the home button, called the following:
OnPause
OnStop
This is called when the application is restored:
OnStart
Onresume
If the phone supports screen rotation, the activity destroys and then re-creates the activity instance after rotation!
If the primary layout file is Xxx.xml, then Xxx-land.xml is the default layout file for widescreen
Activity has the ability to save state information at run time, and the call point function is onsaveinstancestate, which can be within the function
Save any state information you want to a bundle object and wait until the next run, the OnCreate function will provide you
Bundle object, you can take out the status information you want!
====logcat Use = =
Logcat is a component of the Development IDE tool, which is designed to view various log information and to easily filter logs to focus on important log information.
The IDE opens the Logcat process without a breath, if you need to view the log output, if the program needs to log logs, Android provides a log class: Android.util.Log.
Log class Common method Description:
When using it, first define a tag name, indicating which category the log belongs to, Logcat used to select a specific tag, or filter tag keywords; Common methods are as follows:
LOG.E (..) Error message
LOG.W (..) Warning message
LOG.I (..) General Information
LOG.D (..) Debugging information
LOG.V (..) Developers commonly used, development output verbose log
Android Learning-the third day