Navigation - devrath/DroidKotlinCleanArchitecture GitHub Wiki
Navigation types
There are 2
types of navigation in android
- Navigating from
activity
to anotheractivity
- Navigating between the fragments
- If we are following a
1
-activity
andmultiple
fragments
flows then there is no need for acentralized 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 anavigator class
to encapsulate thenavigation invoking
part, we can inject this class in all theactivities
and use the instance to access the invoking method for theactivity
.
Ex
: Define the navigation class that can be injected Then inject in the activities and use the reference.