onStart is called when the activity is about to become visible.
And some typical applications for this method include starting when
visible-only behaviors, like requesting location sensor updates, or
loading or resetting persistent application state,
things like updating the unread messages queue for an email reader application.
The onResume method gets called when the activity is visible and
about to start interacting with the user.
And some things you do in this method are to start foreground-only behaviors,
things like starting animations or playing a background sound track.
onPause is called when your activity is about to lose focus.
In this method,
you can shut down foreground-only behaviors, things like killing animations.
And you should also save any persistent state that the user has edited.
onStop is called when the activity is no longer visible to the user.
At this point, it's possible that the activity may be restarted later.
So, some typical things to do here include caching activity state that
you'll want to restore when the activity is later restarting and onStart is called.
And remember, onStop is not always called when an activity terminates.
For instance, it may not be called if Android kills the application's
process due to low memory.
So don't wait to save persistent data in this method.
Go do that back in onPause.