Skip to content

Instantly share code, notes, and snippets.

@2hamed
Created December 23, 2018 14:44
Show Gist options
  • Select an option

  • Save 2hamed/4af7b00e6accd7a4319f99c96ec74c00 to your computer and use it in GitHub Desktop.

Select an option

Save 2hamed/4af7b00e6accd7a4319f99c96ec74c00 to your computer and use it in GitHub Desktop.
navEvents.subscribe {
when (it.destination) {
NavEvent.Destination.ONE -> navController.popBackStack(R.id.fragmentOne, false)
NavEvent.Destination.TWO -> navController.navigate(R.id.action_fragmentOne_to_fragmentTwo)
NavEvent.Destination.THREE -> navController.navigate(R.id.action_fragmentOne_to_fragmentThree)
NavEvent.Destination.FOUR -> navController.navigate(R.id.action_fragmentTwo_to_fragmentFour)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment