onResume and onPause use case
bangarharshit opened this issue · 2 comments
bangarharshit commented
Is there any use case for onResume and onPause. I can see them being used with activity's lifecycle event but why are they used in navigate.
fabiendevos commented
onResume and onPause are called during navigation for consistency and balance reasons.
For example, if you have a timer constantly updating on your screen, you want to stop this timer both in the case where the App / Activity (it's the same with a Single Activity architecture) is paused (onPause) and when you navigate to a different Screen. Therefore onResume and onPause are also called on navigation.
bangarharshit commented
Thanks