I have a main activity which is showing/hiding a bunch of fragments. There is a login activity at the very start that logs the user in. When the user presses home or the multi-tasking button, the app should start a timer that (after the timer runs out) automatically logs the user out. This could be when the user returns to the app (and timer has run out -> logout) or while in the app and has done nothing.
What exactly gets called when the user presses home/multi-tasking button in terms of the fragment's lifestyle methods? In my quick tests, it seems that the first fragment in the fragment manager's onPause is called everytime no matter the fragment on screen when the user exits out.
How can i go about this?