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.
If it's worth saying, but not worth its own post (even in Discussion), then it goes here.
Notes for future OT posters:
1. Please add the 'open_thread' tag.
2. Check if there is an active Open Thread before posting a new one. (Immediately before; refresh the list-of-threads page before posting.)
3. Open Threads should be posted in Discussion, and not Main.
4. Open Threads should start on Monday, and end on Sunday.