Jetpack Navigation: Getting Started

Aug 10 2021 · Kotlin 1.4, Android 11, Android Studio 4.2.1

Part 2: Create Destinations & Navigate via Actions

07. Pass Data Between Destinations

Episode complete

Play next episode

Next
About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 06. Add Destinations & Navigate via Action Next episode: 08. Animate Transitions Between Destinations

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Heads up... You’re accessing parts of this content for free, with some sections shown as obfuscated text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

In Add Dependecies Episode, you added Safe Args Gradle Plugin. Safe Args is strongly recommended for navigating and passing data, because it ensures type-safety.

 v ->
  val action = LoginFragmentDirections.actionWelcomeFromLogin(user, getString(R.string
      .action_logged_in))
  v.findNavController().navigate(action)
v ->
  val action = SignUpFragmentDirections.actionWelcomeFromSignUp(user, getString(R.string
      .action_signed_up))
  v.findNavController().navigate(action)
arguments?.let {
  val safeArgs = WelcomeFragmentArgs.fromBundle(it)
  param1 = safeArgs.param1
  param2 = safeArgs.param2
}