Android examples for android.support.v4.app:Fragment
pop Previous Fragment From Stack
import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import java.util.List; import java.util.Stack; public class Main{ public static void popPreviousFragmentFromStack( FragmentManager fragmentManager, Stack<Fragment> fragmentStack) { FragmentTransaction ft = fragmentManager.beginTransaction(); fragmentStack.lastElement().onPause(); ft.remove(fragmentStack.pop());//from w w w . j av a2s . c o m fragmentStack.lastElement().onResume(); ft.show(fragmentStack.lastElement()); ft.commit(); } }