Navigation - devrath/DroidKotlinCleanArchitecture GitHub Wiki

Navigation types

There are 2 types of navigation in android

  1. Navigating from activity to another activity
  2. Navigating between the fragments

  • If we are following a 1- activity and multiple fragments flows then there is no need for a centralized navigation mechanism.

Ex: Example on how to implement is available in the developer docs and my GitHub example

  • If we are following the multiple activities approach then better to have a navigator class to encapsulate the navigation invoking part, we can inject this class in all the activities and use the instance to access the invoking method for the activity.

Ex: Define the navigation class that can be injected Then inject in the activities and use the reference.