Two different sets of life cycle methods are available : ActivityLifecycleCallbacks.html and Activity life cycle methods.
If I implement Activity life cycle methods like
onCreate()
onStart()
onActivityCreated(Activity activity, Bundle savedInstanceState)
onActivityStarted(Activity activity)
No, these are separate things. The Activity.onCreate()
, Activity.onStart()
, etc. methods are ones you override within your custom Activity
implementation to do your application specific work.
The Application.ActivityLifecycleCallbacks
are different and can be used for your app to track the coming/going of any Activity
within your app. You really have to have some special needs to use this functionality. These are often used in libraries which use singleton instances or other components which need to know if a given Activity
has been destroyed. Most apps probably do not need to use these callbacks.