I'm trying to use a custom back navigation instead of using the default back arrow. I want to use a cancel icon:
by using app:navigationIcon="@drawable/ic_cancel_white_24dp"
in my XML file.
When I run the app, however, the icon is never displayed. Instead, it shows the default back arrow in black:
I'm using the NAV controller and AppBarConfiguration to set up the toolbar (because the toolbar is styled differently for every fragment I have):
private fun setUpActionBar() {
val navController = findNavController()
val appBarConfiguration = AppBarConfiguration(navController.graph)
binding.toolbar.setupWithNavController(navController, appBarConfiguration)
binding.toolbar.inflateMenu(R.menu.menu)
}
How can I replace the default arrow with my custom icon? Also - why is the default arrow black? Is this a theming issue?