# AppNotIdleException

Artifact: [androidx.test.espresso:espresso-core](https://developer.android.com/jetpack/androidx/releases/test-espresso) [View Source](https://cs.android.com/search?q=file:androidx/test/espresso/AppNotIdleException.java+class:androidx.test.espresso.AppNotIdleException)

*** ** * ** ***


```
class AppNotIdleException : RuntimeException, EspressoException
```

<br />

|---|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) ||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) |||
|   |   | ↳ | [java.lang.RuntimeException](https://developer.android.com/reference/java/lang/RuntimeException.html) ||
|   |   |   | ↳ | [androidx.test.espresso.AppNotIdleException](https://developer.android.com/reference/kotlin/androidx/test/espresso/AppNotIdleException) |

*** ** * ** ***

An exception which indicates that the App has not become idle even after the specified duration.

## Summary

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/kotlin/androidx/test/espresso/AppNotIdleException!` | `https://developer.android.com/reference/kotlin/androidx/test/espresso/AppNotIdleException#create(java.util.List<java.lang.String>,java.lang.String)(idleConditions: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!, message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Creates a new AppNotIdleException suitable for erroring out a test case. |
| `java-static https://developer.android.com/reference/kotlin/androidx/test/espresso/AppNotIdleException!` | `[create](https://developer.android.com/reference/kotlin/androidx/test/espresso/AppNotIdleException#create(java.util.List<java.lang.String>,int,int))(idleConditions: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!, loopCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, seconds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** use `https://developer.android.com/reference/kotlin/androidx/test/espresso/AppNotIdleException#create(java.util.List<java.lang.String>,java.lang.String)` instead <br /> |

| ### Inherited functions |
|---|
| From [java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) |---|---| | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/add-suppressed.html(exception: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!)` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/fill-in-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-cause.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-localized-message.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-message.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!>!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-suppressed.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/init-cause.html(cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/print-stack-trace.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/set-stack-trace.html(stackTrace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/to-string.html()` | |

## Public functions

### create

```
java-static fun create(idleConditions: (Mutable)List<String!>!, message: String!): AppNotIdleException!
```

Creates a new AppNotIdleException suitable for erroring out a test case.

This should be called only from the main thread if the app does not idle out within the specified duration.

| Parameters |
|---|---|
| `idleConditions: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | list of idleConditions that failed to become idle. |
| `message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | a message about the failure. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/espresso/AppNotIdleException!` | a AppNotIdleException suitable to be thrown on the instrumentation thread. |

### create

```
java-static fun [create](https://developer.android.com/reference/kotlin/androidx/test/espresso/AppNotIdleException#create(java.util.List<java.lang.String>,int,int))(idleConditions: (Mutable)List<String!>!, loopCount: Int, seconds: Int): AppNotIdleException!
```

> [!CAUTION]
> **This function is deprecated.**   
>
> use `https://developer.android.com/reference/kotlin/androidx/test/espresso/AppNotIdleException#create(java.util.List<java.lang.String>,java.lang.String)` instead

Creates a new AppNotIdleException suitable for erroring out a test case.

This should be called only from the main thread if the app does not idle out within the specified duration.

| Parameters |
|---|---|
| `idleConditions: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | list of idleConditions that failed to become idle. |
| `loopCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | number of times it was tried to check if they became idle. |
| `seconds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | number of seconds that was tried before giving up. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/espresso/AppNotIdleException!` | a AppNotIdleException suitable to be thrown on the instrumentation thread. |