# ActivityResultMatchers

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

# ActivityResultMatchers

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

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.espresso.contrib.ActivityResultMatchers |

<br />

*** ** * ** ***

Hamcrest matchers for a[Instrumentation.ActivityResult](https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html).

## Summary

|                                                                                                                                                                                                                                                                                                                                          ### Public methods                                                                                                                                                                                                                                                                                                                                          ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static Matcher<? super `[Instrumentation.ActivityResult](https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html)`>` | ` `[hasResultCode](https://developer.android.com/reference/android/support/test/espresso/contrib/ActivityResultMatchers#hasResultCode(int))`(int resultCode) ` Returns a matcher that verifies that the`resultCode`of a given[Instrumentation.ActivityResult](https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html)matches the given code                                                                                                                                                                 |
| ` static Matcher<? super `[Instrumentation.ActivityResult](https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html)`>` | ` `[hasResultData](https://developer.android.com/reference/android/support/test/espresso/contrib/ActivityResultMatchers#hasResultData(org.hamcrest.Matcher<android.content.Intent>))`(Matcher<`[Intent](https://developer.android.com/reference/android/content/Intent.html)`> intentMatcher) ` Returns a matcher that verifies that the resultData of a given[Instrumentation.ActivityResult](https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html)matches the given specification by the`intentMatcher` |

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

### hasResultCode

```
Matcher<? super Instrumentation.ActivityResult> hasResultCode (int resultCode)
```

Returns a matcher that verifies that the`resultCode`of a given[Instrumentation.ActivityResult](https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html)matches the given code

<br />

|         Parameters         ||
|--------------|--------------|
| `resultCode` | `int` <br /> |

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

### hasResultData

```
Matcher<? super Instrumentation.ActivityResult> hasResultData (Matcher<Intent> intentMatcher)
```

Returns a matcher that verifies that the resultData of a given[Instrumentation.ActivityResult](https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html)matches the given specification by the`intentMatcher`

<br />

|            Parameters             ||
|-----------------|------------------|
| `intentMatcher` | `Matcher` <br /> |

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

-

  ## Interfaces

  - [RecyclerViewActions.PositionableRecyclerViewAction](https://developer.android.com/reference/android/support/test/espresso/contrib/RecyclerViewActions.PositionableRecyclerViewAction)
-

  ## Classes

  - [AccessibilityChecks](https://developer.android.com/reference/android/support/test/espresso/contrib/AccessibilityChecks)
  - [ActivityResultMatchers](https://developer.android.com/reference/android/support/test/espresso/contrib/ActivityResultMatchers)
  - [DrawerActions](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerActions)
  - [DrawerMatchers](https://developer.android.com/reference/android/support/test/espresso/contrib/DrawerMatchers)
  - [NavigationViewActions](https://developer.android.com/reference/android/support/test/espresso/contrib/NavigationViewActions)
  - [PickerActions](https://developer.android.com/reference/android/support/test/espresso/contrib/PickerActions)
  - [RecyclerViewActions](https://developer.android.com/reference/android/support/test/espresso/contrib/RecyclerViewActions)
  - [ViewPagerActions](https://developer.android.com/reference/android/support/test/espresso/contrib/ViewPagerActions)