fragment/src/main/java/androidx/fragment/app/Fragment.java
@CallSuper
    public void onInflate(Context context, AttributeSet attrs, Bundle savedInstanceState) {
        mCalled = true;
        final Activity hostActivity = mHost == null ? null : mHost.getActivity();
        if (hostActivity != null) {
            mCalled = false;
            onInflate(hostActivity, attrs, savedInstanceState);
        }
    }
/**
     * Called when a fragment is being created as part of a view layout
     * inflation, typically from setting the content view of an activity.  This
     * may be called immediately after the fragment is created from a <fragment>
     * tag in a layout file.  Note this is <em>before</em> the fragment's
     * {@link #onAttach(Activity)} has been called; all you should do here is
     * parse the attributes and save them away.
     *
     * <p>This is called every time the fragment is inflated, even if it is
     * being inflated into a new instance with saved state.  It typically makes
     * sense to re-parse the parameters each time, to allow them to change with
     * different configurations.</p>
     *
     * <p>Here is a typical implementation of a fragment that can take parameters
     * both through attributes supplied here as well from {@link #getArguments()}:</p>
     *
     * {@sample frameworks/support/samples/Support4Demos/src/main/java/com/example/android/supportv4/app/FragmentArgumentsSupport.java
     *      fragment}
     *
     * <p>Note that parsing the XML attributes uses a "styleable" resource.  The
     * declaration for the styleable used here is:</p>
     *
     * {@sample frameworks/support/samples/Support4Demos/src/main/res/values/attrs.xml fragment_arguments}
     *
     * <p>The fragment can then be declared within its activity's content layout
     * through a tag like this:</p>
     *
     * {@sample frameworks/support/samples/Support4Demos/src/main/res/layout/fragment_arguments_support.xml from_attributes}
     *
     * <p>This fragment can also be created dynamically from arguments given
     * at runtime in the arguments Bundle; here is an example of doing so at
     * creation of the containing activity:</p>
     *
     * {@sample frameworks/support/samples/Support4Demos/src/main/java/com/example/android/supportv4/app/FragmentArgumentsSupport.java
     *      create}
     *
     * @param context The Activity that is inflating this fragment.
     * @param attrs The attributes at the tag where the fragment is
     * being created.
     * @param savedInstanceState If the fragment is being re-created from
     * a previous saved state, this is the state.
     */
Called when a fragment is being created as part of a view layout
inflation, typically from setting the content view of an activity.  This
may be called immediately after the fragment is created from a 
tag in a layout file.  Note this is before the fragment's
#onAttach(Activity) has been called; all you should do here is
parse the attributes and save them away.

This is called every time the fragment is inflated, even if it is
being inflated into a new instance with saved state.  It typically makes
sense to re-parse the parameters each time, to allow them to change with
different configurations.

Here is a typical implementation of a fragment that can take parameters
both through attributes supplied here as well from  #getArguments():



Note that parsing the XML attributes uses a "styleable" resource.  The
declaration for the styleable used here is:



The fragment can then be declared within its activity's content layout
through a tag like this:



This fragment can also be created dynamically from arguments given
at runtime in the arguments Bundle; here is an example of doing so at
creation of the containing activity:



@param context The Activity that is inflating this fragment.
@param attrs The attributes at the tag where the fragment is
being created.
@param savedInstanceState If the fragment is being re-created from
a previous saved state, this is the state.
Called when a fragment is being created as part of a view layout inflation typically from setting the content view of an activity . This may be called immediately after the fragment is created from a tag in a layout file . Note this is before the fragment ' s #onAttach ( Activity ) has been called ; all you should do here is parse the attributes and save them away . This is called every time the fragment is inflated even if it is being inflated into a new instance with saved state . It typically makes sense to re - parse the parameters each time to allow them to change with different configurations . Here is a typical implementation of a fragment that can take parameters both through attributes supplied here as well from #getArguments () : Note that parsing the XML attributes uses a " styleable " resource . The declaration for the styleable used here is : The fragment can then be declared within its activity ' s content layout through a tag like this : This fragment can also be created dynamically from arguments given at runtime in the arguments Bundle ; here is an example of doing so at creation of the containing activity : @param context The Activity that is inflating this fragment . @param attrs The attributes at the tag where the fragment is being created . @param savedInstanceState If the fragment is being re - created from a previous saved state this is the state .
@CallSuper
    public void onInflate(Context context, AttributeSet attrs, Bundle savedInstanceState) {
        mCalled = true;
        final Activity hostActivity = mHost == null ? null : mHost.getActivity();
        if (hostActivity != null) {
            mCalled = false;
            onInflate(hostActivity, attrs, savedInstanceState);
        }
    }
@ CallSuper public void onInflate ( Context context , AttributeSet attrs , Bundle savedInstanceState ) { mCalled = true ; final Activity hostActivity = mHost == null ? null : mHost . getActivity ( ) ; if ( hostActivity != null ) { mCalled = false ; onInflate ( hostActivity , attrs , savedInstanceState ) ; } }
Called when a fragment is being created as part of a view layout
 inflation, typically from setting the content view of an activity.
Called when a fragment is being created as part of a view layout inflation typically from setting the content view of an activity .