TestNavHostController
-
android
class TestNavHostController : NavHostController
| kotlin.Any | |||
| ↳ | androidx.navigation.NavController | ||
| ↳ | androidx.navigation.NavHostController | ||
| ↳ | androidx.navigation.testing.TestNavHostController |
Subclass of NavHostController that offers additional APIs for testing Navigation.
Summary
Public constructors |
|
|---|---|
TestNavHostController(context: Context) |
android
|
Public functions |
||
|---|---|---|
Unit |
setCurrentDestination(destId: @IdRes Int, args: Bundle)Navigate directly to any destination on the current |
android
|
Unit |
setCurrentDestination(destRoute: String, args: Bundle)Navigate directly to any destination on the current |
android
|
Public properties |
||
|---|---|---|
List<NavBackStackEntry> |
Gets an immutable copy of the |
android
|
Inherited functions |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Inherited properties |
||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
Public functions
setCurrentDestination
fun setCurrentDestination(destId: @IdRes Int, args: Bundle = savedState()): Unit
Navigate directly to any destination on the current androidx.navigation.NavGraph via an explicit deep link. If an implicit deep link exists for this destination use #navigate(Uri) instead.
| Parameters | |
|---|---|
destId: @IdRes Int |
The destination id to navigate to. |
args: Bundle = savedState() |
The arguments to pass to the destination. |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
If the |
setCurrentDestination
fun setCurrentDestination(destRoute: String, args: Bundle = savedState()): Unit
Navigate directly to any destination on the current androidx.navigation.NavGraph via an explicit deep link. If an implicit deep link exists for this destination use #navigate(Uri) instead.
| Parameters | |
|---|---|
destRoute: String |
The destination route to navigate to. |
args: Bundle = savedState() |
The arguments to pass to the destination. |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
If the |
Public properties
backStack
val backStack: List<NavBackStackEntry>
Gets an immutable copy of the elements currently on the back stack.