# ApplicationLifecycleMonitorRegistry

Summary:[Methods](https://developer.android.com/reference/android/support/test/runner/lifecycle/ApplicationLifecycleMonitorRegistry#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/test/runner/lifecycle/ApplicationLifecycleMonitorRegistry#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/test/runner/lifecycle/ApplicationLifecycleMonitorRegistry#)  

# ApplicationLifecycleMonitorRegistry

| 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

final

class
ApplicationLifecycleMonitorRegistry
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object.html)`


``


`

|---|---------------------------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | android.support.test.runner.lifecycle.ApplicationLifecycleMonitorRegistry |

<br />

*** ** * ** ***

An exposed registry instance to make it easy for callers to find the application lifecycle monitor for their application.

## Summary

|                                                                                                                                                                                                                                                                                 ### Public methods                                                                                                                                                                                                                                                                                  ||
|----------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[ApplicationLifecycleMonitor](https://developer.android.com/reference/android/support/test/runner/lifecycle/ApplicationLifecycleMonitor) | ` `[getInstance](https://developer.android.com/reference/android/support/test/runner/lifecycle/ApplicationLifecycleMonitorRegistry#getInstance())`() ` Returns the ActivityLifecycleMonitor.                                                                                                                                                                                                                                    |
| ` static void`                                                                                                                                     | ` `[registerInstance](https://developer.android.com/reference/android/support/test/runner/lifecycle/ApplicationLifecycleMonitorRegistry#registerInstance(android.support.test.runner.lifecycle.ApplicationLifecycleMonitor))`(`[ApplicationLifecycleMonitor](https://developer.android.com/reference/android/support/test/runner/lifecycle/ApplicationLifecycleMonitor)` monitor) ` Stores a lifecycle monitor in the registry. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/runner/lifecycle/ApplicationLifecycleMonitorRegistry#)From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                                | | ` boolean`                                                                          | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                             | ` finalize() `                                                                             | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                             | | ` int`                                                                              | ` hashCode() `                                                                             | | ` final void`                                                                       | ` notify() `                                                                               | | ` final void`                                                                       | ` notifyAll() `                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                             | | ` final void`                                                                       | ` wait(long arg0, int arg1) `                                                              | | ` final void`                                                                       | ` wait(long arg0) `                                                                        | | ` final void`                                                                       | ` wait() `                                                                                 | ||

## Public methods

### getInstance

```
ApplicationLifecycleMonitor getInstance ()
```

Returns the ActivityLifecycleMonitor.

This monitor is not guaranteed to be present under all instrumentations.

<br />

|                                                                                                   Returns                                                                                                   ||
|------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| [ApplicationLifecycleMonitor](https://developer.android.com/reference/android/support/test/runner/lifecycle/ApplicationLifecycleMonitor) | ActivityLifecycleMonitor the monitor for this application. <br /> |

|                                                                  Throws                                                                   ||
|-------------------------------------------------------------------------------------------------------|------------------------------------|
| [IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException.html) | if no monitor has been registered. |

### registerInstance

```
void registerInstance (ApplicationLifecycleMonitor monitor)
```

Stores a lifecycle monitor in the registry.

This is a global registry - so be aware of the impact of calling this method!

<br />

|                                                        Parameters                                                         ||
|-----------|----------------------------------------------------------------------------------------------------------------|
| `monitor` | `ApplicationLifecycleMonitor`: the monitor for this application. Null deregisters any existing monitor. <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)