How to change start destination of a navigation graph programmatically [Jetpack]
问题 Basically, I have the following navigation graph: I want to change my starting point in navigation graph to fragment 2 right after reaching it (in order to prevent going back to fragment 1 when pressing back button - like with the splash screen). This is my code: navGraph = navController.getGraph(); navGraph.setStartDestination(R.id.fragment2); navController.setGraph(navGraph); But, obviously it's not working and it gets back to fragment 1 after pressing back button. Am I doing it wrong? Is