# IdlingThreadPoolExecutor

Summary:[Ctors](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#pubctors)\|[Methods](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#pubmethods)\|[Protected Methods](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#)  

# IdlingThreadPoolExecutor

| 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


class
IdlingThreadPoolExecutor
`  
`


``


``

extends `[ThreadPoolExecutor](https://developer.android.com/reference/java/util/concurrent/ThreadPoolExecutor.html)`


``


implements

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


`

|---|---|---|--------------------------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [java.util.concurrent.AbstractExecutorService](https://developer.android.com/reference/java/util/concurrent/AbstractExecutorService.html) |||
|   | ↳ | [java.util.concurrent.ThreadPoolExecutor](https://developer.android.com/reference/java/util/concurrent/ThreadPoolExecutor.html) ||
|   |   | ↳ | android.support.test.espresso.idling.concurrent.IdlingThreadPoolExecutor |

<br />

*** ** * ** ***

A[ThreadPoolExecutor](https://developer.android.com/reference/java/util/concurrent/ThreadPoolExecutor.html)that can be registered as an[IdlingResource](https://developer.android.com/reference/android/support/test/espresso/IdlingResource)with Espresso.

Overrides parent methods to monitor threads starting, and finishing execution. Uses[CountingIdlingResource](https://developer.android.com/reference/android/support/test/espresso/idling/CountingIdlingResource)to track number of active tasks.

**This API is currently in beta.**

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[IdlingThreadPoolExecutor](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#IdlingThreadPoolExecutor(java.lang.String, int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.ThreadFactory))`(`[String](https://developer.android.com/reference/java/lang/String.html)` resourceName, int corePoolSize, int maximumPoolSize, long keepAliveTime, `[TimeUnit](https://developer.android.com/reference/java/util/concurrent/TimeUnit.html)` unit, `[BlockingQueue](https://developer.android.com/reference/java/util/concurrent/BlockingQueue.html)`<`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)`> workQueue, `[ThreadFactory](https://developer.android.com/reference/java/util/concurrent/ThreadFactory.html)` threadFactory) ` Creates a new`IdlingThreadPoolExecutor`with the given initial parameters and default rejected execution handler. |

|                                                                                                                                                                                                                                                                                                                          ### Public methods                                                                                                                                                                                                                                                                                                                           ||
|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                    | ` `[execute](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#execute(java.lang.Runnable))`(`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)` command) `                                                                                                                                                                                                                                                                                                                                      |
| ` `[String](https://developer.android.com/reference/java/lang/String.html) | ` `[getName](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#getName())`() ` Returns the name of the resources (used for logging and idempotency of registration).                                                                                                                                                                                                                                                                                                                                                       |
| ` boolean`                                                                 | ` `[isIdleNow](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#isIdleNow())`() ` Returns`true`if resource is currently idle.                                                                                                                                                                                                                                                                                                                                                                                             |
| ` void`                                                                    | ` `[registerIdleTransitionCallback](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#registerIdleTransitionCallback(android.support.test.espresso.IdlingResource.ResourceCallback))`(`[IdlingResource.ResourceCallback](https://developer.android.com/reference/android/support/test/espresso/IdlingResource.ResourceCallback)` callback) ` Registers the given[IdlingResource.ResourceCallback](https://developer.android.com/reference/android/support/test/espresso/IdlingResource.ResourceCallback)with the resource. |

|                                                                                                                                                                           ### Protected methods                                                                                                                                                                           ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[afterExecute](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#afterExecute(java.lang.Runnable, java.lang.Throwable))`(`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)` r, `[Throwable](https://developer.android.com/reference/java/lang/Throwable.html)` t) ` |
| ` void` | ` `[terminated](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#terminated())`() `                                                                                                                                                                                                              |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#)From class` `[java.util.concurrent.ThreadPoolExecutor](https://developer.android.com/reference/java/util/concurrent/ThreadPoolExecutor.html)` ` |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` void`                                                                                                                                                                              | ` afterExecute(`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)` arg0, `[Throwable](https://developer.android.com/reference/java/lang/Throwable.html)` arg1) ` | | ` void`                                                                                                                                                                              | ` allowCoreThreadTimeOut(boolean arg0) `                                                                                                                                                   | | ` boolean`                                                                                                                                                                           | ` allowsCoreThreadTimeOut() `                                                                                                                                                              | | ` boolean`                                                                                                                                                                           | ` awaitTermination(long arg0, `[TimeUnit](https://developer.android.com/reference/java/util/concurrent/TimeUnit.html)` arg1) `                                                             | | ` void`                                                                                                                                                                              | ` beforeExecute(`[Thread](https://developer.android.com/reference/java/lang/Thread.html)` arg0, `[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)` arg1) `      | | ` void`                                                                                                                                                                              | ` execute(`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)` arg0) `                                                                                            | | ` void`                                                                                                                                                                              | ` finalize() `                                                                                                                                                                             | | ` int`                                                                                                                                                                               | ` getActiveCount() `                                                                                                                                                                       | | ` long`                                                                                                                                                                              | ` getCompletedTaskCount() `                                                                                                                                                                | | ` int`                                                                                                                                                                               | ` getCorePoolSize() `                                                                                                                                                                      | | ` long`                                                                                                                                                                              | ` getKeepAliveTime(`[TimeUnit](https://developer.android.com/reference/java/util/concurrent/TimeUnit.html)` arg0) `                                                                        | | ` int`                                                                                                                                                                               | ` getLargestPoolSize() `                                                                                                                                                                   | | ` int`                                                                                                                                                                               | ` getMaximumPoolSize() `                                                                                                                                                                   | | ` int`                                                                                                                                                                               | ` getPoolSize() `                                                                                                                                                                          | | ` `[BlockingQueue](https://developer.android.com/reference/java/util/concurrent/BlockingQueue.html)`<`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)`>` | ` getQueue() `                                                                                                                                                                             | | ` `[RejectedExecutionHandler](https://developer.android.com/reference/java/util/concurrent/RejectedExecutionHandler.html)                                                            | ` getRejectedExecutionHandler() `                                                                                                                                                          | | ` long`                                                                                                                                                                              | ` getTaskCount() `                                                                                                                                                                         | | ` `[ThreadFactory](https://developer.android.com/reference/java/util/concurrent/ThreadFactory.html)                                                                                  | ` getThreadFactory() `                                                                                                                                                                     | | ` boolean`                                                                                                                                                                           | ` isShutdown() `                                                                                                                                                                           | | ` boolean`                                                                                                                                                                           | ` isTerminated() `                                                                                                                                                                         | | ` boolean`                                                                                                                                                                           | ` isTerminating() `                                                                                                                                                                        | | ` int`                                                                                                                                                                               | ` prestartAllCoreThreads() `                                                                                                                                                               | | ` boolean`                                                                                                                                                                           | ` prestartCoreThread() `                                                                                                                                                                   | | ` void`                                                                                                                                                                              | ` purge() `                                                                                                                                                                                | | ` boolean`                                                                                                                                                                           | ` remove(`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)` arg0) `                                                                                             | | ` void`                                                                                                                                                                              | ` setCorePoolSize(int arg0) `                                                                                                                                                              | | ` void`                                                                                                                                                                              | ` setKeepAliveTime(long arg0, `[TimeUnit](https://developer.android.com/reference/java/util/concurrent/TimeUnit.html)` arg1) `                                                             | | ` void`                                                                                                                                                                              | ` setMaximumPoolSize(int arg0) `                                                                                                                                                           | | ` void`                                                                                                                                                                              | ` setRejectedExecutionHandler(`[RejectedExecutionHandler](https://developer.android.com/reference/java/util/concurrent/RejectedExecutionHandler.html)` arg0) `                             | | ` void`                                                                                                                                                                              | ` setThreadFactory(`[ThreadFactory](https://developer.android.com/reference/java/util/concurrent/ThreadFactory.html)` arg0) `                                                              | | ` void`                                                                                                                                                                              | ` shutdown() `                                                                                                                                                                             | | ` `[List](https://developer.android.com/reference/java/util/List.html)`<`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)`>`                              | ` shutdownNow() `                                                                                                                                                                          | | ` void`                                                                                                                                                                              | ` terminated() `                                                                                                                                                                           | | ` `[String](https://developer.android.com/reference/java/lang/String.html)                                                                                                           | ` toString() `                                                                                                                                                                             | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#)From class` `[java.util.concurrent.AbstractExecutorService](https://developer.android.com/reference/java/util/concurrent/AbstractExecutorService.html)` ` |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` <T> `[List](https://developer.android.com/reference/java/util/List.html)`<`[Future](https://developer.android.com/reference/java/util/concurrent/Future.html)`<T>>` | ` invokeAll(`[Collection](https://developer.android.com/reference/java/util/Collection.html)`<? extends `[Callable](https://developer.android.com/reference/java/util/concurrent/Callable.html)`<T>> arg0) `                                                                                                           | | ` <T> `[List](https://developer.android.com/reference/java/util/List.html)`<`[Future](https://developer.android.com/reference/java/util/concurrent/Future.html)`<T>>` | ` invokeAll(`[Collection](https://developer.android.com/reference/java/util/Collection.html)`<? extends `[Callable](https://developer.android.com/reference/java/util/concurrent/Callable.html)`<T>> arg0, long arg1, `[TimeUnit](https://developer.android.com/reference/java/util/concurrent/TimeUnit.html)` arg2) ` | | ` <T> T`                                                                                                                                                              | ` invokeAny(`[Collection](https://developer.android.com/reference/java/util/Collection.html)`<? extends `[Callable](https://developer.android.com/reference/java/util/concurrent/Callable.html)`<T>> arg0) `                                                                                                           | | ` <T> T`                                                                                                                                                              | ` invokeAny(`[Collection](https://developer.android.com/reference/java/util/Collection.html)`<? extends `[Callable](https://developer.android.com/reference/java/util/concurrent/Callable.html)`<T>> arg0, long arg1, `[TimeUnit](https://developer.android.com/reference/java/util/concurrent/TimeUnit.html)` arg2) ` | | ` <T> `[RunnableFuture](https://developer.android.com/reference/java/util/concurrent/RunnableFuture.html)`<T>`                                                        | ` newTaskFor(`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)` arg0, T arg1) `                                                                                                                                                                                                             | | ` <T> `[RunnableFuture](https://developer.android.com/reference/java/util/concurrent/RunnableFuture.html)`<T>`                                                        | ` newTaskFor(`[Callable](https://developer.android.com/reference/java/util/concurrent/Callable.html)`<T> arg0) `                                                                                                                                                                                                       | | ` <T> `[Future](https://developer.android.com/reference/java/util/concurrent/Future.html)`<T>`                                                                        | ` submit(`[Callable](https://developer.android.com/reference/java/util/concurrent/Callable.html)`<T> arg0) `                                                                                                                                                                                                           | | ` <T> `[Future](https://developer.android.com/reference/java/util/concurrent/Future.html)`<T>`                                                                        | ` submit(`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)` arg0, T arg1) `                                                                                                                                                                                                                 | | ` `[Future](https://developer.android.com/reference/java/util/concurrent/Future.html)`<?>`                                                                            | ` submit(`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)` arg0) `                                                                                                                                                                                                                         | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#)From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                                | | ` boolean`                                                                          | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                             | ` finalize() `                                                                             | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                             | | ` int`                                                                              | ` hashCode() `                                                                             | | ` final void`                                                                       | ` notify() `                                                                               | | ` final void`                                                                       | ` notifyAll() `                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                             | | ` final void`                                                                       | ` wait(long arg0, int arg1) `                                                              | | ` final void`                                                                       | ` wait(long arg0) `                                                                        | | ` final void`                                                                       | ` wait() `                                                                                 | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#)From interface` `[java.util.concurrent.ExecutorService](https://developer.android.com/reference/java/util/concurrent/ExecutorService.html)` ` |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract boolean`                                                                                                                                                            | ` awaitTermination(long arg0, `[TimeUnit](https://developer.android.com/reference/java/util/concurrent/TimeUnit.html)` arg1) `                                                                                                                                                                                         | | ` abstract <T> `[List](https://developer.android.com/reference/java/util/List.html)`<`[Future](https://developer.android.com/reference/java/util/concurrent/Future.html)`<T>>` | ` invokeAll(`[Collection](https://developer.android.com/reference/java/util/Collection.html)`<? extends `[Callable](https://developer.android.com/reference/java/util/concurrent/Callable.html)`<T>> arg0) `                                                                                                           | | ` abstract <T> `[List](https://developer.android.com/reference/java/util/List.html)`<`[Future](https://developer.android.com/reference/java/util/concurrent/Future.html)`<T>>` | ` invokeAll(`[Collection](https://developer.android.com/reference/java/util/Collection.html)`<? extends `[Callable](https://developer.android.com/reference/java/util/concurrent/Callable.html)`<T>> arg0, long arg1, `[TimeUnit](https://developer.android.com/reference/java/util/concurrent/TimeUnit.html)` arg2) ` | | ` abstract <T> T`                                                                                                                                                              | ` invokeAny(`[Collection](https://developer.android.com/reference/java/util/Collection.html)`<? extends `[Callable](https://developer.android.com/reference/java/util/concurrent/Callable.html)`<T>> arg0) `                                                                                                           | | ` abstract <T> T`                                                                                                                                                              | ` invokeAny(`[Collection](https://developer.android.com/reference/java/util/Collection.html)`<? extends `[Callable](https://developer.android.com/reference/java/util/concurrent/Callable.html)`<T>> arg0, long arg1, `[TimeUnit](https://developer.android.com/reference/java/util/concurrent/TimeUnit.html)` arg2) ` | | ` abstract boolean`                                                                                                                                                            | ` isShutdown() `                                                                                                                                                                                                                                                                                                       | | ` abstract boolean`                                                                                                                                                            | ` isTerminated() `                                                                                                                                                                                                                                                                                                     | | ` abstract void`                                                                                                                                                               | ` shutdown() `                                                                                                                                                                                                                                                                                                         | | ` abstract `[List](https://developer.android.com/reference/java/util/List.html)`<`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)`>`               | ` shutdownNow() `                                                                                                                                                                                                                                                                                                      | | ` abstract <T> `[Future](https://developer.android.com/reference/java/util/concurrent/Future.html)`<T>`                                                                        | ` submit(`[Callable](https://developer.android.com/reference/java/util/concurrent/Callable.html)`<T> arg0) `                                                                                                                                                                                                           | | ` abstract <T> `[Future](https://developer.android.com/reference/java/util/concurrent/Future.html)`<T>`                                                                        | ` submit(`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)` arg0, T arg1) `                                                                                                                                                                                                                 | | ` abstract `[Future](https://developer.android.com/reference/java/util/concurrent/Future.html)`<?>`                                                                            | ` submit(`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)` arg0) `                                                                                                                                                                                                                         | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#)From interface` `[android.support.test.espresso.IdlingResource](https://developer.android.com/reference/android/support/test/espresso/IdlingResource)` ` |-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract `[String](https://developer.android.com/reference/java/lang/String.html) | ` `[getName](https://developer.android.com/reference/android/support/test/espresso/IdlingResource#getName())`() ` Returns the name of the resources (used for logging and idempotency of registration).                                                                                                                                                                                                                                                                                                                                                       | | ` abstract boolean`                                                                 | ` `[isIdleNow](https://developer.android.com/reference/android/support/test/espresso/IdlingResource#isIdleNow())`() ` Returns`true`if resource is currently idle.                                                                                                                                                                                                                                                                                                                                                                                             | | ` abstract void`                                                                    | ` `[registerIdleTransitionCallback](https://developer.android.com/reference/android/support/test/espresso/IdlingResource#registerIdleTransitionCallback(android.support.test.espresso.IdlingResource.ResourceCallback))`(`[IdlingResource.ResourceCallback](https://developer.android.com/reference/android/support/test/espresso/IdlingResource.ResourceCallback)` callback) ` Registers the given[IdlingResource.ResourceCallback](https://developer.android.com/reference/android/support/test/espresso/IdlingResource.ResourceCallback)with the resource. | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor#)From interface` `[java.util.concurrent.Executor](https://developer.android.com/reference/java/util/concurrent/Executor.html)` ` |------------------|-------------------------------------------------------------------------------------------------| | ` abstract void` | ` execute(`[Runnable](https://developer.android.com/reference/java/lang/Runnable.html)` arg0) ` | ||

## Public constructors

### IdlingThreadPoolExecutor

```
IdlingThreadPoolExecutor (String resourceName, 
                int corePoolSize, 
                int maximumPoolSize, 
                long keepAliveTime, 
                TimeUnit unit, 
                BlockingQueue<Runnable> workQueue, 
                ThreadFactory threadFactory)
```

Creates a new`IdlingThreadPoolExecutor`with the given initial parameters and default rejected execution handler.

<br />

|                                                                                      Parameters                                                                                       ||
|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `resourceName`    | `String`: the name of the executor (used for logging and idempotency of registration). <br />                                                                      |
| `corePoolSize`    | `int`: the number of threads to keep in the pool, even if they are idle, unless allowCoreThreadTimeOut is set. <br />                                              |
| `maximumPoolSize` | `int`: the maximum number of threads to allow in the pool. <br />                                                                                                  |
| `keepAliveTime`   | `long`: when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating. <br />  |
| `unit`            | `TimeUnit`: the time unit for the keepAliveTime argument. <br />                                                                                                   |
| `workQueue`       | `BlockingQueue`: the queue to use for holding tasks before they are executed. This queue will hold only the Runnable tasks submitted by the execute method. <br /> |
| `threadFactory`   | `ThreadFactory`: the factory to use when the executor creates a new thread. <br />                                                                                 |

## Public methods

### execute

```
void execute (Runnable command)
```

<br />

<br />

|          Parameters          ||
|-----------|-------------------|
| `command` | `Runnable` <br /> |

### getName

```
String getName ()
```

Returns the name of the resources (used for logging and idempotency of registration).

<br />

|                                     Returns                                     ||
|-------------------------------------------------------------------------|--------|
| [String](https://developer.android.com/reference/java/lang/String.html) | <br /> |

### isIdleNow

```
boolean isIdleNow ()
```

Returns`true`if resource is currently idle. Espresso will**always**call this method from the main thread, therefore it should be non-blocking and return immediately.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### registerIdleTransitionCallback

```
void registerIdleTransitionCallback (IdlingResource.ResourceCallback callback)
```

Registers the given[IdlingResource.ResourceCallback](https://developer.android.com/reference/android/support/test/espresso/IdlingResource.ResourceCallback)with the resource. Espresso will call this method:

- with its implementation of[IdlingResource.ResourceCallback](https://developer.android.com/reference/android/support/test/espresso/IdlingResource.ResourceCallback)so it can be notified asynchronously that your resource is idle
- from the main thread, but you are free to execute the callback's onTransitionToIdle from any thread
- once (when it is initially given a reference to your IdlingResource)

You only need to call this upon transition from busy to idle - if the resource is already idle when the method is called invoking the call back is optional and has no significant impact.

<br />

|                      Parameters                      ||
|------------|------------------------------------------|
| `callback` | `IdlingResource.ResourceCallback` <br /> |

## Protected methods

### afterExecute

```
void afterExecute (Runnable r, 
                Throwable t)
```

<br />

<br />

|       Parameters        ||
|-----|--------------------|
| `r` | `Runnable` <br />  |
| `t` | `Throwable` <br /> |

### terminated

```
void terminated ()
```

<br />

<br />

-

  ## Classes

  - [IdlingScheduledThreadPoolExecutor](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingScheduledThreadPoolExecutor)
  - [IdlingThreadPoolExecutor](https://developer.android.com/reference/android/support/test/espresso/idling/concurrent/IdlingThreadPoolExecutor)