This function is a convenience wrapper around the TestNavigationEventCallback constructor that defaults its info type to *. Use this in tests where the specific type of NavigationEventInfo is not relevant.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-27 UTC."],[],[],null,["androidx.navigationevent.testing\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/androidx/navigationevent/testing/package-summary \"View this page in Java\")\nCommon/All\n\nClasses \n\n|-----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|\n| [TestNavigationEventCallback](/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventCallback) | A test implementation of [NavigationEventCallback](/reference/kotlin/androidx/navigationevent/NavigationEventCallback) that records received events and invocation counts. | Cmn |\n| [TestNavigationEventDispatcherOwner](/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventDispatcherOwner) | A test implementation of [NavigationEventDispatcherOwner](/reference/kotlin/androidx/navigationevent/NavigationEventDispatcherOwner) for verifying [NavigationEventDispatcher](/reference/kotlin/androidx/navigationevent/NavigationEventDispatcher) interactions. | Cmn |\n\nTop-level functions summary \n\n|--------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|\n| [TestNavigationEventCallback](/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventCallback)`\u003c*\u003e` | [TestNavigationEventCallback](/reference/kotlin/androidx/navigationevent/testing/package-summary#TestNavigationEventCallback(kotlin.Boolean,kotlin.Function2,kotlin.Function2,kotlin.Function1,kotlin.Function1))`(` ` isEnabled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`,` ` onEventStarted: `[TestNavigationEventCallback](/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventCallback)`\u003c*\u003e.(event: `[NavigationEvent](/reference/kotlin/androidx/navigationevent/NavigationEvent)`) `-\u003e` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`,` ` onEventProgressed: `[TestNavigationEventCallback](/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventCallback)`\u003c*\u003e.(event: `[NavigationEvent](/reference/kotlin/androidx/navigationevent/NavigationEvent)`) `-\u003e` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`,` ` onEventCancelled: `[TestNavigationEventCallback](/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventCallback)`\u003c*\u003e.() `-\u003e` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`,` ` onEventCompleted: `[TestNavigationEventCallback](/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventCallback)`\u003c*\u003e.() `-\u003e` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) `)` Creates an instance of [TestNavigationEventCallback](/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventCallback) without requiring an explicit generic type. | Cmn |\n\nTop-level functions \n\nTestNavigationEventCallback \nCmn \nArtifact: [androidx.navigationevent:navigationevent-testing](/jetpack/androidx/releases/navigationevent) \n[View Source](https://cs.android.com/search?q=file:androidx/navigationevent/testing/TestNavigationEventCallback.kt+function:TestNavigationEventCallback) \nAdded in [1.0.0-alpha07](/jetpack/androidx/releases/navigationevent#1.0.0-alpha07) \n\n```\nfun TestNavigationEventCallback(\n isEnabled: Boolean = true,\n onEventStarted: TestNavigationEventCallback\u003c*\u003e.(event: NavigationEvent) -\u003e Unit = {},\n onEventProgressed: TestNavigationEventCallback\u003c*\u003e.(event: NavigationEvent) -\u003e Unit = {},\n onEventCancelled: TestNavigationEventCallback\u003c*\u003e.() -\u003e Unit = {},\n onEventCompleted: TestNavigationEventCallback\u003c*\u003e.() -\u003e Unit = {}\n): TestNavigationEventCallback\u003c*\u003e\n```\n\nCreates an instance of [TestNavigationEventCallback](/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventCallback) without requiring an explicit generic type.\n\nThis function is a convenience wrapper around the [TestNavigationEventCallback](/reference/kotlin/androidx/navigationevent/testing/TestNavigationEventCallback) constructor that defaults its info type to `*`. Use this in tests where the specific type of [NavigationEventInfo](/reference/kotlin/androidx/navigationevent/NavigationEventInfo) is not relevant."]]