private void showFragment ( ShowcaseFragment fragment ) { final FragmentTransaction fragmentTransaction = getSupportFragmentManager ( ) . beginTransaction ( ) . replace ( R . id . content_main , ( Fragment ) fragment ) ; if ( fragment . getBackstackTag ( ) != null ) { fragmentTransaction . addToBackStack ( fragment . getBackstackTag ( ) ) ; } fragmentTransaction . commit ( ) ; setTitle ( fragment . getTitleId ( ) ) ; }
Utility method to display a specific Fragment . If the tag is not null we add a backstack