App Closes detection 2

Of course, I had thought of this and also of checking whether the device was switched into idle (sleep) mode (using my IdleMode extension). However, both of these things happen when the app goes into the background, i.e. before the app is closed via the task manager, and so does not change anything.

However, if the server connection should already be interrupted when the app goes into the background, this could of course be achieved this way. But then the app would no longer work in the background (= app not visible).