# ActivityLifecycleCallback

# ActivityLifecycleCallback

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


interface
ActivityLifecycleCallback
`  
`


`

|-----------------------------------------------------------------|
| android.support.test.runner.lifecycle.ActivityLifecycleCallback |

<br />

*** ** * ** ***

Callback for monitoring activity lifecycle events. These callbacks are invoked on the main thread, so any long operations or violating the strict mode policies should be avoided.

## Summary

|                                                                                                                                                                                                                                                                                 ### Public methods                                                                                                                                                                                                                                                                                 ||
|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[onActivityLifecycleChanged](https://developer.android.com/reference/android/support/test/runner/lifecycle/ActivityLifecycleCallback#onActivityLifecycleChanged(android.app.Activity, android.support.test.runner.lifecycle.Stage))`(`[Activity](https://developer.android.com/reference/android/app/Activity.html)` activity, `[Stage](https://developer.android.com/reference/android/support/test/runner/lifecycle/Stage)` stage) ` Called on the main thread after an activity has processed its lifecycle change event (for example onResume or onStart) |

## Public methods

### onActivityLifecycleChanged

```
void onActivityLifecycleChanged (Activity activity, 
                Stage stage)
```

Called on the main thread after an activity has processed its lifecycle change event (for example onResume or onStart)

<br />

|                   Parameters                   ||
|------------|------------------------------------|
| `activity` | `Activity`: The activity <br />    |
| `stage`    | `Stage`: its current stage. <br /> |

-

  ## Interfaces

  - [ActivityLifecycleCallback](https://developer.android.com/reference/android/support/test/runner/lifecycle/ActivityLifecycleCallback)
  - [ActivityLifecycleMonitor](https://developer.android.com/reference/android/support/test/runner/lifecycle/ActivityLifecycleMonitor)
  - [ApplicationLifecycleCallback](https://developer.android.com/reference/android/support/test/runner/lifecycle/ApplicationLifecycleCallback)
  - [ApplicationLifecycleMonitor](https://developer.android.com/reference/android/support/test/runner/lifecycle/ApplicationLifecycleMonitor)
-

  ## Classes

  - [ActivityLifecycleMonitorRegistry](https://developer.android.com/reference/android/support/test/runner/lifecycle/ActivityLifecycleMonitorRegistry)
  - [ApplicationLifecycleMonitorRegistry](https://developer.android.com/reference/android/support/test/runner/lifecycle/ApplicationLifecycleMonitorRegistry)
-

  ## Enums

  - [ApplicationStage](https://developer.android.com/reference/android/support/test/runner/lifecycle/ApplicationStage)
  - [Stage](https://developer.android.com/reference/android/support/test/runner/lifecycle/Stage)