Added in API level 14

ActivityLifecycleCallbacks

interface ActivityLifecycleCallbacks
android.app.Application.ActivityLifecycleCallbacks

Summary

Public methods
abstract Unit
onActivityCreated(activity: Activity, savedInstanceState: Bundle?)

Called when the Activity calls android.

abstract Unit

Called when the Activity calls super.onDestroy().

abstract Unit

Called when the Activity calls super.onPause().

open Unit
onActivityPostCreated(activity: Activity, savedInstanceState: Bundle?)

Called as the last step of the Activity being created.

open Unit

Called as the last step of the Activity being destroyed.

open Unit

Called as the last step of the Activity being paused.

open Unit

Called as the last step of the Activity being resumed.

open Unit

Called as the last step of the Activity saving its instance state.

open Unit

Called as the last step of the Activity being started.

open Unit

Called as the last step of the Activity being stopped.

open Unit
onActivityPreCreated(activity: Activity, savedInstanceState: Bundle?)

Called as the first step of the Activity being created.

open Unit

Called as the first step of the Activity being destroyed.

open Unit

Called as the first step of the Activity being paused.

open Unit

Called as the first step of the Activity being resumed.

open Unit

Called as the first step of the Activity saving its instance state.

open Unit

Called as the first step of the Activity being started.

open Unit

Called as the first step of the Activity being stopped.

abstract Unit

Called when the Activity calls super.onResume().

abstract Unit

Called when the Activity calls android.

abstract Unit

Called when the Activity calls super.onStart().

abstract Unit

Called when the Activity calls super.onStop().

Public methods

onActivityCreated

Added in API level 14
abstract fun onActivityCreated(
    activity: Activity,
    savedInstanceState: Bundle?
): Unit

Called when the Activity calls android.app.Activity#onCreate.

Parameters
activity Activity: This value cannot be null.
savedInstanceState Bundle?: This value may be null.

onActivityDestroyed

Added in API level 14
abstract fun onActivityDestroyed(activity: Activity): Unit

Called when the Activity calls super.onDestroy().

Parameters
activity Activity: This value cannot be null.

onActivityPaused

Added in API level 14
abstract fun onActivityPaused(activity: Activity): Unit

Called when the Activity calls super.onPause().

Parameters
activity Activity: This value cannot be null.

onActivityPostCreated

Added in API level 29
open fun onActivityPostCreated(
    activity: Activity,
    savedInstanceState: Bundle?
): Unit

Called as the last step of the Activity being created. This is always called after android.app.Activity#onCreate.

Parameters
activity Activity: This value cannot be null.
savedInstanceState Bundle?: This value may be null.

onActivityPostDestroyed

Added in API level 29
open fun onActivityPostDestroyed(activity: Activity): Unit

Called as the last step of the Activity being destroyed. This is always called after Activity#onDestroy.

Parameters
activity Activity: This value cannot be null.

onActivityPostPaused

Added in API level 29
open fun onActivityPostPaused(activity: Activity): Unit

Called as the last step of the Activity being paused. This is always called after Activity#onPause.

Parameters
activity Activity: This value cannot be null.

onActivityPostResumed

Added in API level 29
open fun onActivityPostResumed(activity: Activity): Unit

Called as the last step of the Activity being resumed. This is always called after Activity#onResume and Activity#onPostResume.

Parameters
activity Activity: This value cannot be null.

onActivityPostSaveInstanceState

Added in API level 29
open fun onActivityPostSaveInstanceState(
    activity: Activity,
    outState: Bundle
): Unit

Called as the last step of the Activity saving its instance state. This is always called afterandroid.app.Activity#onSaveInstanceState.

Parameters
activity Activity: This value cannot be null.
outState Bundle: This value cannot be null.

onActivityPostStarted

Added in API level 29
open fun onActivityPostStarted(activity: Activity): Unit

Called as the last step of the Activity being started. This is always called after Activity#onStart.

Parameters
activity Activity: This value cannot be null.

onActivityPostStopped

Added in API level 29
open fun onActivityPostStopped(activity: Activity): Unit

Called as the last step of the Activity being stopped. This is always called after Activity#onStop.

Parameters
activity Activity: This value cannot be null.

onActivityPreCreated

Added in API level 29
open fun onActivityPreCreated(
    activity: Activity,
    savedInstanceState: Bundle?
): Unit

Called as the first step of the Activity being created. This is always called before android.app.Activity#onCreate.

Parameters
activity Activity: This value cannot be null.
savedInstanceState Bundle?: This value may be null.

onActivityPreDestroyed

Added in API level 29
open fun onActivityPreDestroyed(activity: Activity): Unit

Called as the first step of the Activity being destroyed. This is always called before Activity#onDestroy.

Parameters
activity Activity: This value cannot be null.

onActivityPrePaused

Added in API level 29
open fun onActivityPrePaused(activity: Activity): Unit

Called as the first step of the Activity being paused. This is always called before Activity#onPause.

Parameters
activity Activity: This value cannot be null.

onActivityPreResumed

Added in API level 29
open fun onActivityPreResumed(activity: Activity): Unit

Called as the first step of the Activity being resumed. This is always called before Activity#onResume.

Parameters
activity Activity: This value cannot be null.

onActivityPreSaveInstanceState

Added in API level 29
open fun onActivityPreSaveInstanceState(
    activity: Activity,
    outState: Bundle
): Unit

Called as the first step of the Activity saving its instance state. This is always called before android.app.Activity#onSaveInstanceState.

Parameters
activity Activity: This value cannot be null.
outState Bundle: This value cannot be null.

onActivityPreStarted

Added in API level 29
open fun onActivityPreStarted(activity: Activity): Unit

Called as the first step of the Activity being started. This is always called before Activity#onStart.

Parameters
activity Activity: This value cannot be null.

onActivityPreStopped

Added in API level 29
open fun onActivityPreStopped(activity: Activity): Unit

Called as the first step of the Activity being stopped. This is always called before Activity#onStop.

Parameters
activity Activity: This value cannot be null.

onActivityResumed

Added in API level 14
abstract fun onActivityResumed(activity: Activity): Unit

Called when the Activity calls super.onResume().

Parameters
activity Activity: This value cannot be null.

onActivitySaveInstanceState

Added in API level 14
abstract fun onActivitySaveInstanceState(
    activity: Activity,
    outState: Bundle
): Unit

Called when the Activity calls android.app.Activity#onSaveInstanceState.

Parameters
activity Activity: This value cannot be null.
outState Bundle: This value cannot be null.

onActivityStarted

Added in API level 14
abstract fun onActivityStarted(activity: Activity): Unit

Called when the Activity calls super.onStart().

Parameters
activity Activity: This value cannot be null.

onActivityStopped

Added in API level 14
abstract fun onActivityStopped(activity: Activity): Unit

Called when the Activity calls super.onStop().

Parameters
activity Activity: This value cannot be null.