Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public class BackPressedImpl implements OnBackPressedListener {
  2. private Fragment parent;
  3.  
  4. public BackPressedImpl(Fragment fragment) {
  5. this.parent = fragment;
  6. }
  7.  
  8. @Override
  9. public boolean doBack() {
  10. MainActivity activity = (MainActivity) parent.getActivity();
  11. PagerFragment fragment = (PagerFragment) activity.getSupportFragmentManager().getFragments().get(0);
  12. return fragment.onBackPressed();
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement