1. code :
FragmentFactory factory = mManager.getFragmentFactory(); fragment =
factory.instantiate(mContext.getClassLoader(), className);
2. reason :( It suggests that developers customize factory classes to instantiate Fragments, this instantiateFragment() needed to maintain
forward compatibility)
/** * Instantiates the Fragment via the FragmentManager's * {@link
androidx.fragment.app.FragmentFactory}. * * Note that this method is
<strong>not</strong> responsible for calling * {@link
Fragment#setArguments(Bundle)} on the returned Fragment instance. * * @param
context Context providing the correct {@link ClassLoader} * @param
fragmentManager FragmentManager the Fragment will be added to * @param
className The Fragment to instantiate * @param args The Fragment's arguments,
if any * @return A new fragment instance. * @deprecated Set a custom {@link
androidx.fragment.app.FragmentFactory} via * {@link
FragmentManager#setFragmentFactory(FragmentFactory)} to control * instantiation
of Fragments. */ @SuppressWarnings("DeprecatedIsStillUsed") // needed to
maintain forward compatibility @Deprecated @NonNull public Fragment
instantiateFragment(@NonNull Context context, @NonNull FragmentManager
fragmentManager, @NonNull String className, @SuppressWarnings("unused")
@Nullable Bundle args) { return
fragmentManager.getFragmentFactory().instantiate( context.getClassLoader(),
className); }


©2019-2020 Toolsou All rights reserved,
Vue + Element-ui Drop down box for el-select Get extra parameters ( Essence )2020 year 8 month 2 day TypeScript The use of generics Ai Wei also talks about project management , On grass roots management ( Essence 2020 year 6 month 2 Daily update ) TypeScript Function explanation [AndroidO] [RK3399] -- GPIO Drive and control mode Spark SQL- programming Python realization switch method java Compile time and runtime exceptions in exercises 11-5 Output string at specified position 【Python- data fetch 】 read txt Each line of file generates a list of data