AppNotIdleException


public final class AppNotIdleException extends RuntimeException implements EspressoException


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

Summary

Public methods

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

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

static AppNotIdleException
create(List<String> idleConditions, int loopCount, int seconds)

This method is deprecated.

use create instead

Inherited methods

From java.lang.Throwable
synchronized final void
synchronized Throwable
synchronized Throwable
String
String
StackTraceElement[]
synchronized final Throwable[]
synchronized Throwable
void
void
setStackTrace(StackTraceElement[] stackTrace)
String

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
List<String> idleConditions

list of idleConditions that failed to become idle.

String message

a message about the failure.

Returns
AppNotIdleException

a AppNotIdleException suitable to be thrown on the instrumentation thread.

create

public static AppNotIdleException create(List<String> idleConditions, int loopCount, int seconds)

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
List<String> 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
AppNotIdleException

a AppNotIdleException suitable to be thrown on the instrumentation thread.