Is there a way to determine when another app was closed on android?
Unfortunately, I don't have control of the app in question and as far as I am aware there are no events specific to that app that I can listen for.
By "closed," I mean that said app goes from being visible and in the foreground to not being visible and in the foreground. So this event could be caused by pressing the home button, or the back button until the app disappears, or clicking on a link in the app which causes another app to gain focus.
Basically, I want to detect when a specific app has been closed and either display a notification or pop up a small overlay on the screen.