Application_launching
Occurrence time
Click and start an application from the list of installed applications. An application instance is created.
Action
Do not read configuration information from independent storage, which will reduce the loading speed;
Do not try to recover temporary State data (memory variables );
When an application is started, it is always displayed as a new instance. (Not the last operation)
application_activated
occurrence time
trigger this two conditions must be met simultaneously:
1. when the user uses launcher, chooser, or starts another application, the user leaves the current application.
2. After the launcher or chooser operation is complete, return to the application or back button to return to the application.
this event is not activated when the application is started for the first time.
action
the application should allow users to continue operations as they have never left the application.
temporary data should be recovered, however, you should not try to read data from the independent storage to avoid the possibility of slow running.
Application_deactivated
Occurrence time
The user uses launcher, chooser, or starts another application, leading to the departure of the current application.
But this event will notProgramOccurred when closing
Action
All temporary states (such as session information of the current application) should be saved to state dictionary; all persistent information should be saved to independent storage.
The event can be executed for up to 10 seconds. If the event fails to be executed in more than 10 seconds, the program will be closed rather than entering the tombstone.
Application_closing
Occurrence time
Use the back button to exit the first page of the application
Action
Save all persistent information to independent storage