# IntentMonitor

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/IntentMonitor.java+class:androidx.test.runner.intent.IntentMonitor)

*** ** * ** ***


```
public interface IntentMonitor
```

<br />

*** ** * ** ***

Interface for tests to use when they need to monitor intents used to start activities from the current `https://developer.android.com/reference/android/app/Instrumentation.html`.

Retrieve instances of the monitor through `https://developer.android.com/reference/androidx/test/runner/intent/IntentMonitorRegistry`

`https://developer.android.com/reference/androidx/test/runner/intent/IntentMonitorRegistry`

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/test/runner/intent/IntentMonitor#addIntentCallback(androidx.test.runner.intent.IntentCallback)(https://developer.android.com/reference/androidx/test/runner/intent/IntentCallback callback)` Adds an `https://developer.android.com/reference/androidx/test/runner/intent/IntentCallback`, which will be notified when intents are sent from the current instrumentation process. |
| `abstract void` | `https://developer.android.com/reference/androidx/test/runner/intent/IntentMonitor#removeIntentCallback(androidx.test.runner.intent.IntentCallback)(https://developer.android.com/reference/androidx/test/runner/intent/IntentCallback callback)` Removes a previously registered `https://developer.android.com/reference/androidx/test/runner/intent/IntentCallback`. |

## Public methods

### addIntentCallback

```
abstract void addIntentCallback(IntentCallback callback)
```

Adds an `https://developer.android.com/reference/androidx/test/runner/intent/IntentCallback`, which will be notified when intents are sent from the current instrumentation process.

### removeIntentCallback

```
abstract void removeIntentCallback(IntentCallback callback)
```

Removes a previously registered `https://developer.android.com/reference/androidx/test/runner/intent/IntentCallback`.