Android examples for User Interface:Fragment
add Fragment And To Back Stack
//package com.java2s; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; public class Main { public static void addFragmentAndToBackStack( final FragmentActivity activity, final int containerId, final Fragment fragment) { activity.getSupportFragmentManager().beginTransaction() .add(containerId, fragment).addToBackStack(null) .commitAllowingStateLoss(); }/*from ww w .java 2 s.c o m*/ }