diff --git a/app/src/main/java/app/tivi/home/HomeActivity.kt b/app/src/main/java/app/tivi/home/HomeActivity.kt index b4e2b7903b..f1d23dfaaf 100644 --- a/app/src/main/java/app/tivi/home/HomeActivity.kt +++ b/app/src/main/java/app/tivi/home/HomeActivity.kt @@ -94,8 +94,7 @@ class HomeActivity : TiviActivityMvRxView() { listOf(R.navigation.discover_nav_graph, R.navigation.watched_nav_graph, R.navigation.following_nav_graph, R.navigation.search_nav_graph), supportFragmentManager, - R.id.home_nav_container, - intent + R.id.home_nav_container ).observe(this) { navController -> currentNavController = navController diff --git a/common-ui/src/main/java/app/tivi/extensions/MultipleBackStackNavigationExtensions.kt b/common-ui/src/main/java/app/tivi/extensions/MultipleBackStackNavigationExtensions.kt index 2e355c4fac..c898894c7a 100644 --- a/common-ui/src/main/java/app/tivi/extensions/MultipleBackStackNavigationExtensions.kt +++ b/common-ui/src/main/java/app/tivi/extensions/MultipleBackStackNavigationExtensions.kt @@ -37,7 +37,7 @@ fun BottomNavigationView.setupWithNavController( navGraphIds: List, fragmentManager: FragmentManager, containerId: Int, - intent: Intent + intent: Intent? = null ): LiveData { // Map of tags @@ -136,7 +136,9 @@ fun BottomNavigationView.setupWithNavController( setupItemReselected(graphIdToTagMap, fragmentManager) // Handle deep link - setupDeepLinks(navGraphIds, fragmentManager, containerId, intent) + if (intent != null) { + setupDeepLinks(navGraphIds, fragmentManager, containerId, intent) + } // Finally, ensure that we update our BottomNavigationView when the back stack changes fragmentManager.addOnBackStackChangedListener {