I am using android navigation components to navigate fragments. I can easily set action bar by using this code in the Main Activity :
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
But If I want to hide the supportActionbar in some of the fragments then what should be the best approach?