Skip to content

[Recipe request] Save state when navigating forward #290

Description

@WildOrangutan

Recipe request

In old navigation, there was a way to restore saved state, when navigating forward to destination, that was previously on backstack:

navController.navigate(
    route = route,
    navOptions = navOptions {
        popUpTo<A>{ saveState = true }
        restoreState = true
    }
)

This usecase is documented here:
https://developer.android.com/guide/navigation/backstack#savestate

Use case

I have destinations A and B. When I navigate A -> B-> A, on next navigation to B I would like to restore old B state.

I have no clue how to do this in Nav3.


Please upvote this recipe if you would like to see it created

Metadata

Metadata

Assignees

No one assigned

    Labels

    recipe-requestRequest for a recipe or an update to an existing recipe

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions