Similar to UiController but with one additional method that enables interrupting Espresso
tasks.
This interface used for Espresso internals and shouldn't be called by external users. It's
much safer to let all Espresso tasks to be successfully executed on the main thread.
Loops the main thread until the application goes idle.
Public methods
interruptEspressoTasks
void interruptEspressoTasks ()
Interrupts all Espresso tasks scheduled to be executed on the main thread.
Note: This method is used for Espresso internals and shouldn't be called by external users.
It's much safer to let all Espresso tasks to be successfully executed on the main thread.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# InterruptableUiController\n\nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \\| [\\[Expand All\\]](#) \n\nInterruptableUiController\n=========================\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\n\n\ninterface\nInterruptableUiController\n`\n\n\n`\n\n\nimplements\n\n`[UiController](/reference/android/support/test/espresso/UiController)`\n\n\n`\n\n|--------------------------------------------------------------|\n| android.support.test.espresso.base.InterruptableUiController |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nSimilar to [UiController](/reference/android/support/test/espresso/UiController) but with one additional method that enables interrupting Espresso\ntasks.\n\nThis interface used for Espresso internals and shouldn't be called by external users. It's\nmuch safer to let all Espresso tasks to be successfully executed on the main thread.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[interruptEspressoTasks](/reference/android/support/test/espresso/base/InterruptableUiController#interruptEspressoTasks())`() ` Interrupts all Espresso tasks scheduled to be executed on the main thread. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` `[android.support.test.espresso.UiController](/reference/android/support/test/espresso/UiController)` ` |---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract boolean` | ` `[injectKeyEvent](/reference/android/support/test/espresso/UiController#injectKeyEvent(android.view.KeyEvent))`(`[KeyEvent](https://developer.android.com/reference/android/view/KeyEvent.html)` event) ` Injects a key event into the application. | | ` abstract boolean` | ` `[injectMotionEvent](/reference/android/support/test/espresso/UiController#injectMotionEvent(android.view.MotionEvent))`(`[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent.html)` event) ` Injects a motion event into the application. | | ` abstract boolean` | ` `[injectString](/reference/android/support/test/espresso/UiController#injectString(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String.html)` str) ` Types a string into the application using series of [KeyEvent](https://developer.android.com/reference/android/view/KeyEvent.html)s. | | ` abstract void` | ` `[loopMainThreadForAtLeast](/reference/android/support/test/espresso/UiController#loopMainThreadForAtLeast(long))`(long millisDelay) ` Loops the main thread for a specified period of time. | | ` abstract void` | ` `[loopMainThreadUntilIdle](/reference/android/support/test/espresso/UiController#loopMainThreadUntilIdle())`() ` Loops the main thread until the application goes idle. | ||\n\nPublic methods\n--------------\n\n### interruptEspressoTasks\n\n```\nvoid interruptEspressoTasks ()\n```\n\nInterrupts all Espresso tasks scheduled to be executed on the main thread.\n\nNote: This method is used for Espresso internals and shouldn't be called by external users.\nIt's much safer to let all Espresso tasks to be successfully executed on the main thread.\n\n\u003cbr /\u003e\n\n-\n\n Annotations\n -----------\n\n - [Default](/reference/android/support/test/espresso/base/Default)\n - [MainThread](/reference/android/support/test/espresso/base/MainThread)\n - [RootViewPickerScope](/reference/android/support/test/espresso/base/RootViewPickerScope)\n-\n\n Interfaces\n ----------\n\n - [ActiveRootLister](/reference/android/support/test/espresso/base/ActiveRootLister)\n - [IdlingUiController](/reference/android/support/test/espresso/base/IdlingUiController)\n - [InterruptableUiController](/reference/android/support/test/espresso/base/InterruptableUiController)\n-\n\n Classes\n -------\n\n - [DefaultFailureHandler](/reference/android/support/test/espresso/base/DefaultFailureHandler)\n - [IdlingResourceRegistry](/reference/android/support/test/espresso/base/IdlingResourceRegistry)\n - [RootViewPicker](/reference/android/support/test/espresso/base/RootViewPicker)\n - [ViewFinderImpl](/reference/android/support/test/espresso/base/ViewFinderImpl)"]]