In my project I need to distinguish between the app being in the background or the app was closed.
Example: I start up my app, and I log in, but I don't check the Stay logged in box. So If I close the App, It should log me out before it closes. (This is easily acquirable) BUT: The app can open google maps, and dial screen, which also puts the app in the background, so the Activity's onStop will be called too. And If I return from these screens to the App, I should remain logged in.