# IntentMonitorRegistry

Artifact: [androidx.test:monitor](https://developer.android.com/jetpack/androidx/releases/test) [View Source](https://cs.android.com/search?q=file:androidx/test/runner/intent/IntentMonitorRegistry.java+class:androidx.test.runner.intent.IntentMonitorRegistry)

*** ** * ** ***


```
public final class IntentMonitorRegistry
```

<br />

*** ** * ** ***

Exposes an implementation of `https://developer.android.com/reference/androidx/test/runner/intent/IntentMonitor` to users.

## Summary

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/test/runner/intent/IntentMonitor` | `https://developer.android.com/reference/androidx/test/runner/intent/IntentMonitorRegistry#getInstance()()` Returns the IntentMonitor. |
| `static void` | `https://developer.android.com/reference/androidx/test/runner/intent/IntentMonitorRegistry#registerInstance(androidx.test.runner.intent.IntentMonitor)(https://developer.android.com/reference/androidx/test/runner/intent/IntentMonitor monitor)` Stores the given `https://developer.android.com/reference/androidx/test/runner/intent/IntentMonitor` instance in the registry. |

## Public methods

### getInstance

```
public static IntentMonitor getInstance()
```

Returns the IntentMonitor. This monitor is not guaranteed to be present under all' instrumentations.

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

### registerInstance

```
public static void registerInstance(IntentMonitor monitor)
```

Stores the given `https://developer.android.com/reference/androidx/test/runner/intent/IntentMonitor` instance in the registry. Passing null removes the monitor from the registry.