Android examples for User Interface:Fragment
replace With Back Stack
//package com.java2s; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; public class Main { public static void replaceWithBackStack(FragmentManager fm, int container, Fragment fragment, String tag) { fm.beginTransaction().replace(container, fragment, tag) .addToBackStack(tag).commit(); }// w w w. ja v a2s . c o m public static void replace(FragmentManager fm, int container, Fragment fragment, String tag) { fm.beginTransaction().replace(container, fragment, tag).commit(); } }