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

    int scrollY = mScrollView.getScrollY(); // for verticalScrollView
    mListener.onScrollY(scrollY, 0, mFragmentId);
  }
 @Override
 public void onDetach() {
   super.onDetach();
   mListener = null;
 }
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   mListener = (OnScrollListener) activity;
 }