In docs , onDestroy should be called right before the action is destroyed, regardless of the reason. If a finish was requested, isFinishing will return true. Therefore, if this is a lie, you can assume that the system should have finished.
However, as the docs say,
Note: do not count on this method called data storage location!
In general, you cannot guarantee that your activity will be killed beautifully. Things like task killers get involved in the life cycle.
Use onPause or onSaveInstanceState to save correctly.
source share