# ResettingStubberImpl

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

# ResettingStubberImpl

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

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


``


implements

`[ResettingStubber](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubber)`


`

|---|-----------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | android.support.test.espresso.intent.ResettingStubberImpl |

<br />

*** ** * ** ***

Implementation of[ResettingStubber](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubber)

## Summary

|                                                                   ### Public constructors                                                                   ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[ResettingStubberImpl](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubberImpl#ResettingStubberImpl())`() ` |

|                                                                                                                                                                                                                                                                                                                                                                                                          ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                           ||
|------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[Instrumentation.ActivityResult](https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html) | ` `[getActivityResultForIntent](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubberImpl#getActivityResultForIntent(android.content.Intent))`(`[Intent](https://developer.android.com/reference/android/content/Intent.html)` intent) ` Returns the first matching stubbed result for the given activity if stubbed result was set by test author.                                                                                                                                                                                                                                                                                                             |
| ` void`                                                                                                                      | ` `[initialize](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubberImpl#initialize())`() ` Marks this spy as initialized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` boolean`                                                                                                                   | ` `[isInitialized](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubberImpl#isInitialized())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` void`                                                                                                                      | ` `[reset](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubberImpl#reset())`() ` Clears state (initialization, expected responses).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` void`                                                                                                                      | ` `[setActivityResultForIntent](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubberImpl#setActivityResultForIntent(org.hamcrest.Matcher<android.content.Intent>, android.app.Instrumentation.ActivityResult))`(Matcher<`[Intent](https://developer.android.com/reference/android/content/Intent.html)`> matcher, `[Instrumentation.ActivityResult](https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html)` result) ` Sets the result that will be returned to the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched.                                           |
| ` void`                                                                                                                      | ` `[setActivityResultFunctionForIntent](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubberImpl#setActivityResultFunctionForIntent(org.hamcrest.Matcher<android.content.Intent>, android.support.test.espresso.intent.ActivityResultFunction))`(Matcher<`[Intent](https://developer.android.com/reference/android/content/Intent.html)`> matcher, `[ActivityResultFunction](https://developer.android.com/reference/android/support/test/espresso/intent/ActivityResultFunction)` result) ` Sets a result function that will be called by the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubberImpl#)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() `                                                                                 | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubberImpl#)From interface` `[android.support.test.espresso.intent.ResettingStubber](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubber)` ` |---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void`    | ` `[initialize](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubber#initialize())`() ` Marks this spy as initialized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` abstract boolean` | ` `[isInitialized](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubber#isInitialized())`() `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` abstract void`    | ` `[reset](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubber#reset())`() ` Clears state (initialization, expected responses).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | | ` abstract void`    | ` `[setActivityResultForIntent](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubber#setActivityResultForIntent(org.hamcrest.Matcher<android.content.Intent>, android.app.Instrumentation.ActivityResult))`(Matcher<`[Intent](https://developer.android.com/reference/android/content/Intent.html)`> matcher, `[Instrumentation.ActivityResult](https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html)` result) ` Sets the result that will be returned to the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched.                                           | | ` abstract void`    | ` `[setActivityResultFunctionForIntent](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubber#setActivityResultFunctionForIntent(org.hamcrest.Matcher<android.content.Intent>, android.support.test.espresso.intent.ActivityResultFunction))`(Matcher<`[Intent](https://developer.android.com/reference/android/content/Intent.html)`> matcher, `[ActivityResultFunction](https://developer.android.com/reference/android/support/test/espresso/intent/ActivityResultFunction)` result) ` Sets a result function that will be called by the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched. | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubberImpl#)From interface` `[android.support.test.runner.intent.IntentStubber](https://developer.android.com/reference/android/support/test/runner/intent/IntentStubber)` ` |---------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract `[Instrumentation.ActivityResult](https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html) | ` `[getActivityResultForIntent](https://developer.android.com/reference/android/support/test/runner/intent/IntentStubber#getActivityResultForIntent(android.content.Intent))`(`[Intent](https://developer.android.com/reference/android/content/Intent.html)` intent) ` Returns the first matching stubbed result for the given activity if stubbed result was set by test author. | ||

## Public constructors

### ResettingStubberImpl

```
ResettingStubberImpl ()
```

<br />

<br />

## Public methods

### getActivityResultForIntent

```
Instrumentation.ActivityResult getActivityResultForIntent (Intent intent)
```

Returns the first matching stubbed result for the given activity if stubbed result was set by test author. The method searches the list of existing matcher/response pairs in reverse order of which they were entered; i.e. the last stubbing has the highest priority. If no stubbed result matching the given intent is found,`null`is returned.

Must be called on main thread.

<br />

|        Parameters         ||
|----------|-----------------|
| `intent` | `Intent` <br /> |

|                                                              Returns                                                              ||
|---------------------------------------------------------------------------------------------------------------------------|--------|
| [Instrumentation.ActivityResult](https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html) | <br /> |

### initialize

```
void initialize ()
```

Marks this spy as initialized. Once initialized, ResettingStubber begins recording intents and provides intent stubbing.

<br />

### isInitialized

```
boolean isInitialized ()
```

<br />

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### reset

```
void reset ()
```

Clears state (initialization, expected responses).

Must be called on main thread.

<br />

### setActivityResultForIntent

```
void setActivityResultForIntent (Matcher<Intent> matcher, 
                Instrumentation.ActivityResult result)
```

Sets the result that will be returned to the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched.

<br />

|                     Parameters                     ||
|-----------|-----------------------------------------|
| `matcher` | `Matcher` <br />                        |
| `result`  | `Instrumentation.ActivityResult` <br /> |

### setActivityResultFunctionForIntent

```
void setActivityResultFunctionForIntent (Matcher<Intent> matcher, 
                ActivityResultFunction result)
```

Sets a result function that will be called by the intent sender (if the sender expects the result), next time an intent matched by the given matcher is launched.

<br />

|                 Parameters                 ||
|-----------|---------------------------------|
| `matcher` | `Matcher` <br />                |
| `result`  | `ActivityResultFunction` <br /> |

-

  ## Interfaces

  - [ActivityResultFunction](https://developer.android.com/reference/android/support/test/espresso/intent/ActivityResultFunction)
  - [ResettingStubber](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubber)
  - [ResolvedIntent](https://developer.android.com/reference/android/support/test/espresso/intent/ResolvedIntent)
  - [VerifiableIntent](https://developer.android.com/reference/android/support/test/espresso/intent/VerifiableIntent)
  - [VerificationMode](https://developer.android.com/reference/android/support/test/espresso/intent/VerificationMode)
-

  ## Classes

  - [Checks](https://developer.android.com/reference/android/support/test/espresso/intent/Checks)
  - [Intents](https://developer.android.com/reference/android/support/test/espresso/intent/Intents)
  - [OngoingStubbing](https://developer.android.com/reference/android/support/test/espresso/intent/OngoingStubbing)
  - [ResettingStubberImpl](https://developer.android.com/reference/android/support/test/espresso/intent/ResettingStubberImpl)
  - [VerificationModes](https://developer.android.com/reference/android/support/test/espresso/intent/VerificationModes)