# IntentStubberRegistry

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

*** ** * ** ***


```
public final class IntentStubberRegistry
```

<br />

*** ** * ** ***

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

## Summary

| ### Public fields |
|---|---|
| `static https://developer.android.com/reference/androidx/test/runner/intent/IntentStubber` | `https://developer.android.com/reference/androidx/test/runner/intent/IntentStubberRegistry#instance()` |

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/test/runner/intent/IntentStubber` | `https://developer.android.com/reference/androidx/test/runner/intent/IntentStubberRegistry#getInstance()()` Returns the loaded Intent Stubber instance. |
| `static boolean` | `https://developer.android.com/reference/androidx/test/runner/intent/IntentStubberRegistry#isLoaded()()` |
| `static void` | `https://developer.android.com/reference/androidx/test/runner/intent/IntentStubberRegistry#load(androidx.test.runner.intent.IntentStubber)(https://developer.android.com/reference/androidx/test/runner/intent/IntentStubber intentStubber)` Loads an `https://developer.android.com/reference/androidx/test/runner/intent/IntentStubber` into this registry. |
| `synchronized static void` | `https://developer.android.com/reference/androidx/test/runner/intent/IntentStubberRegistry#reset()()` Clears the current instance of Intent Stubber. |

## Public fields

### instance

```
public static IntentStubber instance
```

## Public methods

### getInstance

```
public static IntentStubber getInstance()
```

Returns the loaded Intent Stubber instance.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | if this method is not called on the main thread. |
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | if no Intent Stubber has been loaded. |

### isLoaded

```
public static boolean isLoaded()
```

| Returns |
|---|---|
| `boolean` | if an `https://developer.android.com/reference/androidx/test/runner/intent/IntentStubber` has been loaded. |

### load

```
public static void load(IntentStubber intentStubber)
```

Loads an `https://developer.android.com/reference/androidx/test/runner/intent/IntentStubber` into this registry. There can only be one active stubber at a time.

Calling this method multiple times in the same instrumentation will result in an exception.

This method can be called from any thread.

### reset

```
synchronized public static void reset()
```

Clears the current instance of Intent Stubber.