Skip to content

Navigation in activity onNewIntent #149

Description

@ghostmane0404

Let's consider a scenario where we have an activity with two screens: ListScreen and DetailScreen. The activity is defined as follows:
class SomeActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
  
    setContent {
        Navigator(
            remember {
                ListScreen(),
                DetailScreen(someId)
            },
        )
    }
}

override fun onNewIntent(intent: Intent) {
    super.onNewIntent(intent)
}

}
When a user opens a deep link, the onNewIntent method is triggered, and we want to redirect them to the DetailScreen. How can i do that, is navigator accesible in activity?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    deeplinkdocsImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions