IdlingResource.ResourceCallback


interface IdlingResource.ResourceCallback


Registered by an IdlingResource to notify Espresso of a transition to idle.

Summary

Public functions

Unit

Called when the resource goes from busy to idle.

Public functions

onTransitionToIdle

fun onTransitionToIdle(): Unit

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 isIdleNow returning true before the callback is invoked.