List of usage examples for android.view LayoutInflater setPrivateFactory
@UnsupportedAppUsage public void setPrivateFactory(Factory2 factory)
From source file:android.app.FragmentState.java
/** * @hide Hack so that DialogFragment can make its Dialog before creating * its views, and the view construction can use the dialog's context for * inflation. Maybe this should become a public API. Note sure. *///from w w w.j a v a 2 s . c om public LayoutInflater getLayoutInflater(Bundle savedInstanceState) { // Newer platform versions use the child fragment manager's LayoutInflaterFactory. if (mActivity.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.LOLLIPOP) { LayoutInflater result = mActivity.getLayoutInflater().cloneInContext(mActivity); getChildFragmentManager(); // Init if needed; use raw implementation below. result.setPrivateFactory(mChildFragmentManager.getLayoutInflaterFactory()); return result; } else { return mActivity.getLayoutInflater(); } }