Q: Android issue NavigationView with NavigationDrawer I am using NavigationView with DrawerLayout.
My code:
NavHeaderMainBinding navHeaderMainBinding = DataBindingUtil.inflate(getLayoutInflater(),
            R.layout.nav_header_main, mActivityMainBinding.navigationView, false);
    mActivityMainBinding.navigationView.addHeaderView(navHeaderMainBinding.getRoot());
    navHeaderMainBinding.setViewModel(mMainViewModel);
    addNavigationItem();
    NavigationUI.setupWithNavController(mActivityMainBinding.navigationView, navController);
mNavigationView.setNavigationItemSelectedListener(
        item -> {
            mDrawer.closeDrawer(GravityCompat.START);

            switch (item.getItemId()) {
                case 0:
                    // setFragment(AboutFragment.newInstance(), AboutFragment.TAG);
                    navController.navigate(R.id.nav_home);

                    return true;
                case 1:
                    navController.navigate(R.id.nav_paging);

                    //       RateUsDialog.newInstance().show(getSupportFragmentManager());
                    return true;
                case 2:
                    // startActivity(FeedActivity.newIntent(MainActivity.this));
                    return true;
                case 3:
                    mMainViewModel.logout();
                    return true;
                default:
                    return false;
            }
        });

now the issue is that when I click on second item many times from navigation drawer its create many objects and create an issue in the back press. When I back press its close all object of the second fragment then return to the first fragment.
I want to create the only single instance of all fragments which open on click of navigation drawer item.
How could I achieve this?
