Dnveeraj
Dnveeraj

Reputation: 138

Best Practice of using Navigation Component. Activities only or only Fragments or Both of them together?

I am working with Navigation in android and multiple questions came up:

  1. If an android application only consist of activities, is it good practice to make NavGraph for activities?

  2. Or NavGraph should only be used with Fragments ?

  3. Or NavGraph can used with both Fragment and Activities ?

Example Scenario 1 : Android application contains HomeActivity with a Bottom Navigation View then while creating nav_graph what will be startDestination activity or fragment of bottom navigation view ?

Example Scenario 2 : Android application contains HomeActivity with a Navigation Drawer then while creating nav_graph what will be the startDestination ?

Upvotes: 0

Views: 35

Answers (0)

Related Questions