I am going from fragment A to fragment B. Now when I click on backpress, the `onResume()` method in fragment A is not called. Does anyone know what can be the cause for this?

This is what I have tried and its `onResume` is not called:

```
 public class CurrencyFragment extends android.support.v4.app.Fragment {
public static String imagepath = null;
static ArrayList<EquityDetails> catListDao = new ArrayList<EquityDetails>();
static ArrayList<EquityDetails> catListDao1 = new ArrayList<EquityDetails>();
static int count = 0;
static boolean ab = false;
ListView list;
TextView empty_text;
View view;
Activity act;
AdvisorsAdapter adapter;
ImageView progressBar;
CustomToast toast;
AnimatorSet set;
private boolean isViewShown = false;

public static com.advisorymandi.CurrencyFragment newInstance() {
    return new com.advisorymandi.CurrencyFragment();
}

@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
    super.setUserVisibleHint(isVisibleToUser);
    if (isVisibleToUser) {
        isViewShown = true;
        if (adapter != null) {
            adapter.filter("");
        }
    } else {
        isViewShown = false;
    }
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    view = inflater.inflate(R.layout.equity_activity, container, false);
    act = this.getActivity();
    Constants.check_fragment_visible = 1;
    count++;
    return view;
}

public void onActivityCreated(Bundle savedInstanceState1) {
    super.onActivityCreated(savedInstanceState1);
    setHasOptionsMenu(true);
    list = (ListView) view.findViewById(R.id.list_equity);
    empty_text = (TextView) view.findViewById(R.id.empty);
    progressBar = (ImageView) view.findViewById(R.id.progressBar);
    set = (AnimatorSet) AnimatorInflater.loadAnimator(getActivity(), R.animator.fadein);
    set.setTarget(progressBar);
    progressBar.setVisibility(View.GONE);
    if (Utils.isNetworkAvailable(getActivity())) {
        if (catListDao.size() > 0) {
            adapter = new AdvisorsAdapter(act, R.layout.custom_equity, catListDao, 0);
            list.setAdapter(adapter);
        } else {
            if (!isViewShown) {
                new FetchAllData(getActivity(), 4).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
            }
        }
    } else {
        toast = new CustomToast(getActivity(), "There is no internet connection!");
    }
}

@Override
public void onResume() {
    super.onResume();
    if (adapter != null) adapter.notifyDataSetChanged();
    Constants.check_fragment_visible = 1;
    if (Constants.check_reload) {
        if (Utils.isNetworkAvailable(getActivity())) {
            if (!isViewShown) {
                new FetchAllData(getActivity(), 4).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
            } else {
            }
        } else {
            toast = new CustomToast(getActivity(), "There is no internet connection!");
        }
    }
}

@Override
public void onPause() {
    super.onPause();

}

}
}

```