I have this issue in Android. Consider three Fragments: `A`, `B`, `C`. `C` can be called from `A` or from `B`. Is there anyway to know from which fragment, `C` was called?

**Edited**

Ok guys I'm going to explain what I'm trying to do. Suppose I have this call: A calls B, B calls C. 

When I press the back button in C It gets me to B, thats fine. But when I press the back button again, it takes me to C, instead of A.

This is my code:

```
@Override
public void onBackPressed() { 

    //this is the current fragment
    Fragment fragmentActual =     this.getSupportFragmentManager().findFragmentById(android.R.id.tabcontent);

    String fragmentTag = fragmentoActual.getTag().toString();

            //If I press the back button in C:
    if(fragmentTag.equals("TAG C")){

        Fragment removefragment = this.getSupportFragmentManager().findFragmentByTag("TAG B");
        Fragment fragmentClient = this.getSupportFragmentManager().findFragmentByTag("TAG C");

        //If Im NOT passing arguments to B, I know this is a new form
        if(removefragment.getArguments()== null){

                            //I always pass arguments to fragment C, but just in case:
            if(fragmentClient.getArguments()!= null){

                Bundle mArguments = fragmentClient.getArguments();

                                    //FRAGMENT B
                FragmentB  fragmentB = new FragmentB ();
                fragment.setArguments(mArguments);

                FragmentManager manager = this.getSupportFragmentManager();
                FragmentTransaction ft = manager.beginTransaction();

                ft.addToBackStack(null);
                    ft.replace(android.R.id.tabcontent,fragmentB,"TAG B");
                    ft.commit();
                }
        }else{

            super.onBackPressed();
        }

    }else{
        super.onBackPressed();
    }

}   

```

Now I'm going to explain the code. Basically what it does is to replace fragment B, when fragment C is called. I do this, because I need to pass arguments to fragment B. But when I do the replacement, the "history" of the fragment B is lost, I mean when I press back button in B, I cant go back to fragment A **(HERE IS WHY I WANTED TO KNOW IF I CAN KNOW WHO CALLS WHOM)**. 

The firts time when I call fragment B, I dont pass arguments because is a blank form. But when I call to C, staying in B, I need to pass arguments to fragment B (when back button is pressed), so It can shows updated information.

Please if there something that is not clear, let me know so I can explain myself better.

**Edited 2:** This issue has something with this <https://stackoverflow.com/questions/16703604/back-press-button-when-i-save-a-form-for-the-first-time-a-list-view-is-not-updat>. Maybe it does my idea more clear.