I cannot find the official documentation telling me that yes, the application class can be killed in low memory.
Below are links to where it was indicated:
I cannot find any official diagram representing the application life cycle.
This is a reasonable remark ... Although the following opinion is based on opinions, I believe that such a diagram contradicts the philosophy of "multitasking" for Android, as described in the last link:
βThe key to how Android processes applications in this way is that processes do not close cleanly. When a user leaves the application, his process is supported in the background, which allows him to continue to work (for example, loading web pages of a page) if this is necessary, and immediately go to the forefront if the user returns to it.If the device never has enough memory, then Android will support all these processes, really leaving all applications βrunningβ all the time. β
I cannot find the proper callback to use if the application class is killed with the exception of onLowMemory() . Does this mean that I should use this method to save my data?
Regarding onLowMemory() , whose description is pretty simple, are we talking about the background process or the foreground of the UI? ...
If none of the Activities applications is in the foreground and the operating system is inactive in memory, this may lead to the removal of the application, so that none of the Application callbacks or the application component ( Activity , Service ) will be called, However ( since you are dealing with Activities ), I recommend storing all persistent data in accordance with the documentation in onPause () .
If the application class is killed at low memory pressure and the application reappears in the foreground, how can I find in onCreate() that the application was restored after a system crash?
You cannot recognize it in Application onCreate() .