# 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)

*** ** * ** ***


```
public final class AppNotIdleException extends RuntimeException implements EspressoException
```

<br />

|---|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||||
| ↳ | [kotlin.Throwable](https://developer.android.com/reference/java/lang/Throwable.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/androidx/test/espresso/AppNotIdleException) |

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/test/espresso/AppNotIdleException` | `https://developer.android.com/reference/androidx/test/espresso/AppNotIdleException#create(java.util.List<java.lang.String>,java.lang.String)(https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html> idleConditions, https://developer.android.com/reference/java/lang/String.html message)` Creates a new AppNotIdleException suitable for erroring out a test case. |
| `static https://developer.android.com/reference/androidx/test/espresso/AppNotIdleException` | `[create](https://developer.android.com/reference/androidx/test/espresso/AppNotIdleException#create(java.util.List<java.lang.String>,int,int))(https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html> idleConditions, int loopCount, int seconds)` **This method is deprecated.** use `https://developer.android.com/reference/androidx/test/espresso/AppNotIdleException#create(java.util.List<java.lang.String>,java.lang.String)` instead <br /> |

### Inherited methods

From [java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) `synchronized final void` `https://developer.android.com/reference/java/lang/Throwable.html#addSuppressed(java.lang.Throwable)(https://developer.android.com/reference/java/lang/Throwable.html exception)` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#fillInStackTrace()()` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#getCause()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#getLocalizedMessage()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#getMessage()()` `StackTraceElement[]` `https://developer.android.com/reference/java/lang/Throwable.html#getStackTrace()()` `synchronized final Throwable[]` `https://developer.android.com/reference/java/lang/Throwable.html#getSuppressed()()` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#initCause(java.lang.Throwable)(https://developer.android.com/reference/java/lang/Throwable.html cause)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace()()` `void` `https://developer.android.com/reference/java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[])(StackTraceElement[] stackTrace)` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#toString()()`

## Public methods

### create

```
public static AppNotIdleException create(List<String> idleConditions, String message)
```

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 |
|---|---|
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html> idleConditions` | list of idleConditions that failed to become idle. |
| `https://developer.android.com/reference/java/lang/String.html message` | a message about the failure. |

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

### create

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

> [!CAUTION]
> **This method is deprecated.**   
>
> use `https://developer.android.com/reference/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 |
|---|---|
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html> idleConditions` | list of idleConditions that failed to become idle. |
| `int loopCount` | number of times it was tried to check if they became idle. |
| `int seconds` | number of seconds that was tried before giving up. |

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