# IdlingResource.ResourceCallback

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

*** ** * ** ***


```
public interface IdlingResource.ResourceCallback
```

<br />

*** ** * ** ***

Registered by an `https://developer.android.com/reference/androidx/test/espresso/IdlingResource` to notify Espresso of a transition to idle.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/test/espresso/IdlingResource.ResourceCallback#onTransitionToIdle()()` Called when the resource goes from busy to idle. |

## Public methods

### onTransitionToIdle

```
abstract void onTransitionToIdle()
```

Called when the resource goes from busy to idle.

If the idle state is updated on a thread other than the main thread, this method should be called **before** the state is updated to return true. Failing to do so can cause a race condition where Espresso throws a consistency error due to observing `https://developer.android.com/reference/androidx/test/espresso/IdlingResource#isIdleNow()` returning true before the callback is invoked.