public void startFragment ( Fragment fragment , String tag , boolean canAddToBackstack ) { FragmentTransaction transaction = getSupportFragmentManager ( ) . beginTransaction ( ) . replace ( R . id . fragmentContainer , fragment ) ; if ( canAddToBackstack ) { transaction . addToBackStack ( tag ) ; } transaction . commit ( ) ; }
Start given Fragment