architecture-components-samples icon indicating copy to clipboard operation
architecture-components-samples copied to clipboard

Navigation Components back stack not working with java code

Open sunnyeverestek opened this issue 3 years ago • 0 comments

NavHostFragment navHostFragment = (NavHostFragment) getSupportFragmentManager().findFragmentById(R.id.base_container);

    if (navHostFragment != null) {
        navController = navHostFragment.getNavController();
        NavigationUI.setupWithNavController(viewBind.bottomNav, navController);

        setSupportActionBar(viewBind.appBar.toolbar);
        appBarConfiguration =  new AppBarConfiguration.Builder(R.id.discoveryFragment,R.id.analyticsFragment
        ,R.id.feedFragment,R.id.notificationFragment).build();

        NavigationUI.setupActionBarWithNavController(this,navController,appBarConfiguration);
    }

sunnyeverestek avatar Jan 27 '22 13:01 sunnyeverestek