Swiping applications off the screen doesn’t actually close them. It just removes them from the list.
The Android OS transparently closes applications based on memory pressure. You’re never supposed to have to do it yourself, and it’ll transparently reopen them to their previous state based on persistence files.
It usually works. Of course, sometimes apps get it wrong.
It does seem to send a message to the app to which the App can listen with “onTaskRemoved()” and the default behavior is closing the App. If something really want to close an App the app can do it’s cleanup under “onDestroy()”. Because onDestroy doesn’t get called directly it’s up to the App to decide whether it wants to close.
My self written app with doesn’t do anything specific to handle the case closes automatically based on what the console says.
Swiping applications off the screen doesn’t actually close them. It just removes them from the list.
I think this is not actually true. The OS can close applications behind your back, but swiping an application off does remove it from memory, quite reliably. Things are done this way because Android devices have comparatively limited RAM and no swap space, so the system must proactively avoid memory pressure. This state of things might improve somewhat as recent Linux versions have added things like swap-to-compressed-memory and volatile memory that help save on RAM usage.
Swiping applications off the screen doesn’t actually close them. It just removes them from the list.
The Android OS transparently closes applications based on memory pressure. You’re never supposed to have to do it yourself, and it’ll transparently reopen them to their previous state based on persistence files.
It usually works. Of course, sometimes apps get it wrong.
It does seem to send a message to the app to which the App can listen with “onTaskRemoved()” and the default behavior is closing the App. If something really want to close an App the app can do it’s cleanup under “onDestroy()”. Because onDestroy doesn’t get called directly it’s up to the App to decide whether it wants to close.
My self written app with doesn’t do anything specific to handle the case closes automatically based on what the console says.
I think this is not actually true. The OS can close applications behind your back, but swiping an application off does remove it from memory, quite reliably. Things are done this way because Android devices have comparatively limited RAM and no swap space, so the system must proactively avoid memory pressure. This state of things might improve somewhat as recent Linux versions have added things like swap-to-compressed-memory and volatile memory that help save on RAM usage.