If you want to save data or have data-related operations, it is best to do so in the OnPause function, because the OnDestroy function may not execute.
There is situations where the system would simply kill the activity ' s hosting process without calling this method (or any Others) in it, so it should is used to does things that is intended to remain around after the process goes away.
The above is the official website, the meaning is that, there are many situations in which the system will simply kill the activity of the host process without invoking its OnDestroy method, so in this method do not do anything about preserving data or state related operations.
This is a life cycle diagram of the activity of the official website, and we can see that the activity has two exits, and OnStop may go directly to the APP process killed without executing the OnDestroy function.
Android finish does not execute ondestory ()