1

This question is about Navigation Component in Android using Kotlin.

Imagine you have fragment A and B as destination and action A_B which connects A to B. In order to navigate to fragment B, you can use "navigate" method in NavController to navigate directly to destination B or to navigate to action A_B, both of which will take you to fragment B.

So, what is the difference between navigating to a destination or action? What's the point of having actions anyway?

Harry
  • 323
  • 3
  • 10

1 Answers1

1

You are not navigating to an action. You're navigating to a destination with the help of an action. The actions represent all the possible navigation paths in your app. They also allow you to specify any arguments you wish to pass, how you wish to animate the transition, and how you want to handle the backstack while navigating.

Gavin Wright
  • 3,124
  • 3
  • 14
  • 35