I'm using a navigation graph to host my fragments. How do I add back button from more_menu_help so that it can go back to nav_more?
I tried to do the following, however, the back arrow icon appears in nav_payments, nav_benefits, and nav_more fragments. I just want to add back arrow to the more_menu_help:
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val navController = Navigation.findNavController(this, R.id.nav_host_fragment)
nav_bar.setupWithNavController(navController)
// Set up ActionBar
setSupportActionBar(toolbar)
setupActionBarWithNavController(this, navController, null)
nav_bar.setupWithNavController(navController)
supportActionBar?.setDisplayHomeAsUpEnabled(false)
supportActionBar?.setDisplayShowHomeEnabled(false)
supportActionBar?.setDisplayShowTitleEnabled(false)
}
See the benefits screen. The navigation up back button arrow shows up here, which I do not want.