Get back to a fragment from an Activity

Simplest way :

@Override
onBackPressed(){
finish();
}

First, Override the back press to goto the activity where the fragments are :-

@Override
public void onBackPressed()
{

    Intent intent = new Intent(CurrentActivity.this,ActivityYouLikeToGo.class);

    intent.putExtra("Check",1);
    startActivity(intent);
}

then goto the ActivityYouLikeToGo.java file and in onCreate do this:-

Intent intent = getIntent();
String s1 = intent.getStringExtra("Check");

if(s1.equals("1"))
  {
s1 = "";
Fragment fragment = new YOURFRAMENTNAME();
if (fragment != null) {
            FragmentManager fragmentManager = getFragmentManager();
            fragmentManager.beginTransaction()
                    .replace(R.id.frame_container, fragment).commit();
  }
}

You can add a TAG (A string name for the fragment basically) and then load the fragment using findFragmentByTag().

Google documentation for findFragmentByTag() is here.

Or you can also addToBackStack() while calling the fragment from FragmentTransaction, doc link here. from google docs:

"By calling addToBackStack(), the replace transaction is saved to the back stack so the user can reverse the transaction and bring back the previous fragment by pressing the Back button."