Android examples for User Interface:Fragment
show And Remove Fragments
//package com.java2s; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; public class Main { public static void showAndRemoveFragments(FragmentManager fm, Fragment showFragment, Fragment removeFragment, int inAnimationId, int outAnimationId) { fm.beginTransaction()//from w ww.j a v a 2 s.c o m .setCustomAnimations(inAnimationId, outAnimationId) .remove(removeFragment).show(showFragment) .commitAllowingStateLoss(); } }