{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ActivityResultMatchers

public final class ActivityResultMatchers


Hamcrest matchers for a ActivityResult.

Summary

Public constructors

Public methods

static Matcher<Object>
hasResultCode(int resultCode)

Returns a matcher that verifies that the resultCode of a given ActivityResult matches the given code

static Matcher<Object>
hasResultData(Matcher<Intent> intentMatcher)

Returns a matcher that verifies that the resultData of a given ActivityResult matches the given specification by the intentMatcher

Public constructors

ActivityResultMatchers

public final ActivityResultMatchers()

Public methods

hasResultCode

public static Matcher<ObjecthasResultCode(int resultCode)

Returns a matcher that verifies that the resultCode of a given ActivityResult matches the given code

hasResultData

public static Matcher<ObjecthasResultData(Matcher<Intent> intentMatcher)

Returns a matcher that verifies that the resultData of a given ActivityResult matches the given specification by the intentMatcher