Skip to content

Most visited

Recently visited

navigation

IntentStubber

public interface IntentStubber

android.support.test.runner.intent.IntentStubber
Known Indirect Subclasses


Interface to intercept activity launch for a given Intent and stub Instrumentation.ActivityResult its response.

Retrieve instances of the stubber through IntentStubberRegistry

Stubbing intents requires support from Instrumentation, therefore do not expect an instance to be present under any arbitrary instrumentation.

Summary

Public methods

abstract Instrumentation.ActivityResult getActivityResultForIntent(Intent intent)

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

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.

Parameters
intent Intent
Returns
Instrumentation.ActivityResult
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.