I have 3 fragments like fragment A , Fragment B, Fragment C. Initially Fragment A is loaded and Fragment A adds Fragment B , Similarly Fragment B again adds Fragment C.Now When I click backpress or any buttoms in Fragment C , it shows directly fragment A. Why it is not showing Fragment B ? I just want to remove the current fragment c and show fragment b but how please help me .here is my code.

```
//This is FragmentA and it adds FragmentB
 fragmentManager = getSupportFragmentManager();
            fragmentTransaction = fragmentManager.beginTransaction();
            fragmentTransaction.add(R.id.activity_main,new FragmentB());
            fragmentTransaction.addToBackStack(null);
            fragmentTransaction.commit();

//This is FragmentB and it adds FragmentC
FragmentManager fragmentManager = getChildFragmentManager();
            FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
            fragmentTransaction.add(R.id.publicCommunication,new FragmentC());
            fragmentTransaction.addToBackStack(null);
            fragmentTransaction.commit();

//This is FragmentC and button is available remove cuurent fragment. now here is my problem , it removes both fragmentC and FragmentB and Shows FragmentA. I want it to show FragmentC but it is not showing it shows fragmentA.
 button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                FragmentManager manager = getActivity().getSupportFragmentManager();
                 manager.popBackStackImmediate();
            }
        });

```