@Override
 public void onResume() {
   super.onResume();
   LocalBroadcastManager.getInstance(getActivity())
       .registerReceiver(mChatButtonReceiver, mChatButtonIntentFilter);
   LocalBroadcastManager.getInstance(getActivity())
       .registerReceiver(mChatLaunchReceiver, mChatLaunchIntentFilter);
 }
  @Override
  public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {

    if (requestCode == AppConstants.RequestCodes.LOGIN_TO_CHAT) {

      final ProfileFragment profileFragment =
          (ProfileFragment) getChildFragmentManager().findFragmentByTag(FragmentTags.USER_PROFILE);

      if (profileFragment != null && profileFragment.isAttached()) {

        profileFragment.onActivityResult(requestCode, resultCode, data);
      }

    } else {
      super.onActivityResult(requestCode, resultCode, data);
    }
  }
 @Override
 public void onPause() {
   super.onPause();
   LocalBroadcastManager.getInstance(getActivity()).unregisterReceiver(mChatButtonReceiver);
   LocalBroadcastManager.getInstance(getActivity()).unregisterReceiver(mChatLaunchReceiver);
 }
 @Override
 public void onSaveInstanceState(final Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putInt(Keys.BOOK_POSITION, mBookDetailPager.getCurrentItem());
 }