Skip to content

Instantly share code, notes, and snippets.

@shawnthye
Created November 14, 2021 12:15
Show Gist options
  • Save shawnthye/94257c6957668fc31700c573cfd5a203 to your computer and use it in GitHub Desktop.
Save shawnthye/94257c6957668fc31700c573cfd5a203 to your computer and use it in GitHub Desktop.
Workaround for Bottom Navigation with Jetpack Navigation 2.4.0-beta02 reselected
bottomNavigationView.setOnItemReselectedListener { menu ->
val destination = navController.graph[menu.itemId]
val graph = destination as? NavGraph ?: return@setOnItemReselectedListener
navController.popBackStack(graph.startDestinationId, false)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment