1 android.support.v4.app.,而且必须是getSupportFragmentManager(); FragmentManager f = getFragmentManager(); f.beginTransaction().replace(R.id.home_container,fragment).commit();
/**
* Return the FragmentManager for interacting with fragments associated
* with this activity.
*
* @deprecated Use {@link android.support.v4.app.FragmentActivity#getSupportFragmentManager()}
*/
@Deprecated
public FragmentManager getFragmentManager() {
return mFragments.getFragmentManager();
}
2 android.app.Fragment.,而且必须是getFragmentManager(); FragmentManager f = getFragmentManager(); f.beginTransaction().replace(R.id.home_container,fragment).commit(); /** * Return the FragmentManager for interacting with fragments associated * with this activity. * * @deprecated Use {@link android.support.v4.app.FragmentActivity#getSupportFragmentManager()} */ @Deprecated public FragmentManager getFragmentManager() { return mFragments.getFragmentManager(); }
|