android/src/com/mapswithme/maps/base/BaseMwmFragmentActivity.java
public void replaceFragment(Class<? extends Fragment> fragmentClass, boolean addToBackStack, Bundle args)
  {
    final int resId = getFragmentContentResId();
    if (resId <= 0 || findViewById(resId) == null)
      throw new IllegalStateException("Fragment can't be added, since getFragmentContentResId() isn't implemented or returns wrong resourceId.");

    final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();

    String name = fragmentClass.getName();
    final Fragment fragment = Fragment.instantiate(this, name, args);
    transaction.replace(resId, fragment, name);
    if (addToBackStack)
      transaction.addToBackStack(null);
    transaction.commit();
  }
/**
   * Replace attached fragment with the new one.
   */
Replace attached fragment with the new one.
Replace attached fragment with the new one .
public void replaceFragment(Class<? extends Fragment> fragmentClass, boolean addToBackStack, Bundle args)
  {
    final int resId = getFragmentContentResId();
    if (resId <= 0 || findViewById(resId) == null)
      throw new IllegalStateException("Fragment can't be added, since getFragmentContentResId() isn't implemented or returns wrong resourceId.");
    final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    String name = fragmentClass.getName();
    final Fragment fragment = Fragment.instantiate(this, name, args);
    transaction.replace(resId, fragment, name);
    if (addToBackStack)
      transaction.addToBackStack(null);
    transaction.commit();
  }
public void replaceFragment ( Class < ? extends Fragment > fragmentClass , boolean addToBackStack , Bundle args ) { final int resId = getFragmentContentResId ( ) ; if ( resId <= 0 || findViewById ( resId ) == null ) throw new IllegalStateException ( "Fragment can't be added, since getFragmentContentResId() isn't implemented or returns wrong resourceId." ) ; final FragmentTransaction transaction = getSupportFragmentManager ( ) . beginTransaction ( ) ; String name = fragmentClass . getName ( ) ; final Fragment fragment = Fragment . instantiate ( this , name , args ) ; transaction . replace ( resId , fragment , name ) ; if ( addToBackStack ) transaction . addToBackStack ( null ) ; transaction . commit ( ) ; }
Replace attached fragment with the new one.
Replace attached fragment with the new one .