# InterruptableUiController

Summary:[Methods](https://developer.android.com/reference/android/support/test/espresso/base/InterruptableUiController#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/test/espresso/base/InterruptableUiController#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/test/espresso/base/InterruptableUiController#)  

# InterruptableUiController

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


interface
InterruptableUiController
`  
`


implements

`[UiController](https://developer.android.com/reference/android/support/test/espresso/UiController)`


`

|--------------------------------------------------------------|
| android.support.test.espresso.base.InterruptableUiController |

<br />

*** ** * ** ***

Similar to[UiController](https://developer.android.com/reference/android/support/test/espresso/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.

## Summary

|                                                                                                                      ### Public methods                                                                                                                      ||
|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[interruptEspressoTasks](https://developer.android.com/reference/android/support/test/espresso/base/InterruptableUiController#interruptEspressoTasks())`() ` Interrupts all Espresso tasks scheduled to be executed on the main thread. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/base/InterruptableUiController#)From interface` `[android.support.test.espresso.UiController](https://developer.android.com/reference/android/support/test/espresso/UiController)` ` |---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract boolean` | ` `[injectKeyEvent](https://developer.android.com/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](https://developer.android.com/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](https://developer.android.com/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](https://developer.android.com/reference/android/support/test/espresso/UiController#loopMainThreadForAtLeast(long))`(long millisDelay) ` Loops the main thread for a specified period of time.                                                                                                                                | | ` abstract void`    | ` `[loopMainThreadUntilIdle](https://developer.android.com/reference/android/support/test/espresso/UiController#loopMainThreadUntilIdle())`() ` 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.

<br />

-

  ## Annotations

  - [Default](https://developer.android.com/reference/android/support/test/espresso/base/Default)
  - [MainThread](https://developer.android.com/reference/android/support/test/espresso/base/MainThread)
  - [RootViewPickerScope](https://developer.android.com/reference/android/support/test/espresso/base/RootViewPickerScope)
-

  ## Interfaces

  - [ActiveRootLister](https://developer.android.com/reference/android/support/test/espresso/base/ActiveRootLister)
  - [IdlingUiController](https://developer.android.com/reference/android/support/test/espresso/base/IdlingUiController)
  - [InterruptableUiController](https://developer.android.com/reference/android/support/test/espresso/base/InterruptableUiController)
-

  ## Classes

  - [DefaultFailureHandler](https://developer.android.com/reference/android/support/test/espresso/base/DefaultFailureHandler)
  - [IdlingResourceRegistry](https://developer.android.com/reference/android/support/test/espresso/base/IdlingResourceRegistry)
  - [RootViewPicker](https://developer.android.com/reference/android/support/test/espresso/base/RootViewPicker)
  - [ViewFinderImpl](https://developer.android.com/reference/android/support/test/espresso/base/ViewFinderImpl)