# IntentStubberRegistry

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

# IntentStubberRegistry

| 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
IntentStubberRegistry
`  
`

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.intent.IntentStubberRegistry |

<br />

*** ** * ** ***

Exposes an implementation of[IntentStubber](https://developer.android.com/reference/android/support/test/runner/intent/IntentStubber).

## Summary

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

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/runner/intent/IntentStubberRegistry#)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

```
IntentStubber getInstance ()
```

Returns the loaded Intent Stubber mInstance.

<br />

|                                                      Returns                                                      ||
|-----------------------------------------------------------------------------------------------------------|--------|
| [IntentStubber](https://developer.android.com/reference/android/support/test/runner/intent/IntentStubber) | <br /> |

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

### isLoaded

```
boolean isLoaded ()
```

<br />

<br />

|                                                                     Returns                                                                      ||
|-----------|---------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | if an[IntentStubber](https://developer.android.com/reference/android/support/test/runner/intent/IntentStubber)has been loaded. <br /> |

### load

```
void load (IntentStubber intentStubber)
```

Loads an[IntentStubber](https://developer.android.com/reference/android/support/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.

<br />

|               Parameters                ||
|-----------------|------------------------|
| `intentStubber` | `IntentStubber` <br /> |

### reset

```
void reset ()
```

Clears the current instance of Intent Stubber.

<br />

-

  ## Interfaces

  - [IntentCallback](https://developer.android.com/reference/android/support/test/runner/intent/IntentCallback)
  - [IntentMonitor](https://developer.android.com/reference/android/support/test/runner/intent/IntentMonitor)
  - [IntentStubber](https://developer.android.com/reference/android/support/test/runner/intent/IntentStubber)
-

  ## Classes

  - [IntentMonitorRegistry](https://developer.android.com/reference/android/support/test/runner/intent/IntentMonitorRegistry)
  - [IntentStubberRegistry](https://developer.android.com/reference/android/support/test/runner/intent/IntentStubberRegistry)