List of usage examples for android.app Fragment getFragmentManager
final public FragmentManager getFragmentManager()
From source file:Main.java
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) public static FragmentManager getChildFragmentManagerIfAvailable(Fragment fragment) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { return fragment.getChildFragmentManager(); } else {//from ww w.j ava2s. c o m return fragment.getFragmentManager(); } }
From source file:com.afwsamples.testdpc.policy.keyguard.LockScreenPolicyFragment.java
private void showSetTrustAgentFragment() { int type = isParentProfileInstance() ? Type.PARENT : Type.SELF; SetTrustAgentConfigFragment fragment = SetTrustAgentConfigFragment.newInstance(type); Fragment containerFragment = getParentFragment(); if (containerFragment == null) { containerFragment = this; }// w ww .jav a 2 s . c om containerFragment.getFragmentManager().beginTransaction() .addToBackStack(SetTrustAgentConfigFragment.class.getName()).hide(containerFragment) .add(R.id.container, fragment).commit(); }