The best way to understand would be to have all the LifeCycle methods overridden in your activity and placing a breakpoint(if checking in emulator) or a Log in each one of them. You'll get to know which one gets called when.
Just as an spoiler, onCreate()
gets called first, then if you paused the activity by either going to home screen or by launching another activity, onPause()
gets called. If the OS destroys the activity in the meantime, onDestroy()
gets called. If you resume the app and the app already got destroyed, onCreate()
will get called, or else onResume()
will get called.
Edit: I forgot about onStop()
, it gets called before onDestroy()
.
Do the exercise I mentioned and you'll be having a better understanding.