# ActivityResultMatchers

Artifact: [androidx.test.espresso:espresso-contrib](https://developer.android.com/jetpack/androidx/releases/test-espresso) [View Source](https://cs.android.com/search?q=file:androidx/test/espresso/contrib/ActivityResultMatchers.java+class:androidx.test.espresso.contrib.ActivityResultMatchers)

*** ** * ** ***


```
class ActivityResultMatchers
```

<br />

*** ** * ** ***

Hamcrest matchers for a `https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html`.

## Summary

| ### Public functions |
|---|---|
| `java-static https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html!>!` | `https://developer.android.com/reference/kotlin/androidx/test/espresso/contrib/ActivityResultMatchers#hasResultCode(int)(resultCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns a matcher that verifies that the `resultCode` of a given `https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html` matches the given code |
| `java-static https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html!>!` | `https://developer.android.com/reference/kotlin/androidx/test/espresso/contrib/ActivityResultMatchers#hasResultData(org.hamcrest.Matcher<android.content.Intent>)(intentMatcher: https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/android/content/Intent.html!>!)` Returns a matcher that verifies that the resultData of a given `https://developer.android.com/reference/android/app/Instrumentation.ActivityResult.html` matches the given specification by the `intentMatcher` |

## Public functions

### hasResultCode

```
java-static fun hasResultCode(resultCode: Int): Matcher<Instrumentation.ActivityResult!>!
```

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

### hasResultData

```
java-static fun hasResultData(intentMatcher: Matcher<Intent!>!): Matcher<Instrumentation.ActivityResult!>!
```

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