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

KeyEventAction

public final class KeyEventAction extends KeyEventActionBase

java.lang.Object
   ↳ androidx.test.espresso.action.KeyEventActionBase
     ↳ androidx.test.espresso.action.KeyEventAction

Enables pressing KeyEvents on views.

Summary

Public constructors

Public methods

void
perform(UiController uiController, View view)

Performs this action on the given view.

Inherited methods

From class androidx.test.espresso.action.KeyEventActionBase
Matcher<View>

A mechanism for ViewActions to specify what type of views they can operate on.

String

Returns a description of the view action.

Inherited Constants

From class androidx.test.espresso.action.KeyEventActionBase

Public constructors

KeyEventAction

public KeyEventAction(EspressoKey espressoKey)

Public methods

perform

public void perform(UiController uiController, View view)

Performs this action on the given view.

Parameters
UiController uiController

the controller to use to interact with the UI.

View view

the view to act upon. never null.