IdlingResource.ResourceCallback


public interface IdlingResource.ResourceCallback


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

Summary

Public methods

abstract void

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