interface ResettingStubber : IntentStubber

Known direct subclasses

A sneaky singleton object used to respond to intents with fake responses. This interface is not meant for public consumption. Test authors should use Intents instead.

Summary

Public functions

Unit

Marks this spy as initialized.

Boolean
Unit

Clears state (initialization, expected responses).

Unit

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.

Unit

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 functions

From androidx.test.runner.intent.IntentStubber
Instrumentation.ActivityResult!

Returns the first matching stubbed result for the given activity if stubbed result was set by test author.

Public functions

initialize

fun initialize(): Unit

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

isInitialized

fun isInitialized(): Boolean
Returns
Boolean

true if this spy is initialized

reset

fun reset(): Unit

Clears state (initialization, expected responses).

Must be called on main thread.

setActivityResultForIntent

fun setActivityResultForIntent(
    matcher: Matcher<Intent!>!,
    result: Instrumentation.ActivityResult!
): Unit

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.

setActivityResultFunctionForIntent

fun setActivityResultFunctionForIntent(
    matcher: Matcher<Intent!>!,
    result: ActivityResultFunction!
): Unit

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.