Android examples for User Interface:Fragment
replace Fragment
//package com.java2s; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; public class Main { public static void replaceFragment(final FragmentActivity activity, final int containerId, final Fragment fragment) { activity.getSupportFragmentManager().beginTransaction() .replace(containerId, fragment).commitAllowingStateLoss(); }/*from ww w .jav a2 s.com*/ }