Skip to content

Instantly share code, notes, and snippets.

@hoolrory
Created October 25, 2016 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoolrory/d66f38c82f3f51fdeec0c5145c9586b7 to your computer and use it in GitHub Desktop.
Save hoolrory/d66f38c82f3f51fdeec0c5145c9586b7 to your computer and use it in GitHub Desktop.
protected void showFragment( Fragment frag, boolean addToBackStack ) {
FragmentTransaction t = getSupportFragmentManager().beginTransaction();
t.replace( R.id.fragment_frame, frag, null );
if ( addToBackStack ) {
t.addToBackStack( null );
}
t.commit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment