Skip to content

Instantly share code, notes, and snippets.

@masarugen
Created May 12, 2015 15:56
Show Gist options
  • Save masarugen/635872ca0891ff8fcaa3 to your computer and use it in GitHub Desktop.
Save masarugen/635872ca0891ff8fcaa3 to your computer and use it in GitHub Desktop.
public void nextMain() {
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.setCustomAnimations(R.anim.test_in, 0, 0, R.anim.test_out);
ft.add(R.id.fragment, new MainActivityFragment());
ft.addToBackStack(null);
ft.commit();
}
public void nextSecond() {
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.setCustomAnimations(R.anim.abc_slide_in_bottom, R.anim.abc_slide_out_top, R.anim.abc_slide_in_top, R.anim.abc_slide_out_bottom);
ft.add(R.id.fragment, new SecondActivityFragment());
ft.addToBackStack(null);
ft.commit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment