Search code examples
androiduinavigationcontrollerandroid-jetpack-navigation

JetPack Navigation component with more than one activity?


Is it possible to use the navigation component with more than one activity?


Solution

  • If you have two activities and their fragments. You can easily create multiple navigation graph to navigate for each activity. And if you would like to navigate from an activity/fragment to another activity, you need to make a separate navigation graph for replacing startActivity. You can see the examples here ,

    https://developer.android.com/guide/navigation/navigation-migrate#add