Beispiel #1
0
 private void popFragmentStack() {
   if (((MainActivity) getActivity()).getOnKeyBackPressedListener() instanceof FanFragment) {
     if (mFM.getBackStackEntryCount() > 0) {
       mFM.popBackStack();
     } else {
       MainActivity activity = (MainActivity) getActivity();
       activity.setOnKeyBackPressedListener(null);
       activity.onBackPressed();
     }
   }
 }
 @Override
 public void onBack() {
   if (((MainActivity) getActivity()).getOnKeyBackPressedListener()
       instanceof NotificationFragment) {
     if (mFM.getBackStackEntryCount() > 0) {
       mFM.popBackStack();
     } else {
       MainActivity activity = (MainActivity) getActivity();
       activity.setOnKeyBackPressedListener(null);
       activity.onBackPressed();
     }
   }
 }