pressBackReliably

fun UiDevice.pressBackReliably(uiAutomation: UiAutomation = InstrumentationRegistry.getInstrumentation().uiAutomation): Boolean(source)

Navigates back and reports whether the system accepted the action.

UiDevice.pressBack() reports failure when no content-change event follows within about a second, which Compose navigation often doesn't emit, so a successful back can read as a failure. This dispatches the global back action and falls back to the back key.

Return

true when back was dispatched.

Parameters

uiAutomation

The automation connection that dispatches the action.