android - Lifecycle of fragments when user "quits" -
i have main activity showing/hiding bunch of fragments. there login activity @ start logs user in. when user presses home or multi-tasking button, app should start timer (after timer runs out) automatically logs user out. when user returns app (and timer has run out -> logout) or while in app , has done nothing.
what gets called when user presses home/multi-tasking button in terms of fragment's lifestyle methods? in quick tests, seems first fragment in fragment manager's onpause called everytime no matter fragment on screen when user exits out.
how can go this?
please have @ tutorial fragment-lifecycle:
http://developer.android.com/reference/android/app/fragment.html#lifecycle
it explains lifecycle of fragment respect activity.
when user presses home-button example:
onpause() - fragment no longer interacting user either because activity being paused or fragment operation modifying in activity.
Comments
Post a Comment