compat/src/main/java/androidx/core/app/TaskStackBuilder.java
@NonNull
    public TaskStackBuilder addParentStack(@NonNull Activity sourceActivity) {
        Intent parent = null;
        if (sourceActivity instanceof SupportParentable) {
            parent = ((SupportParentable) sourceActivity).getSupportParentActivityIntent();
        }
        if (parent == null) {
            parent = NavUtils.getParentActivityIntent(sourceActivity);
        }

        if (parent != null) {
            // We have the actual parent intent, build the rest from static metadata
            // then add the direct parent intent to the end.
            ComponentName target = parent.getComponent();
            if (target == null) {
                target = parent.resolveActivity(mSourceContext.getPackageManager());
            }
            addParentStack(target);
            addNextIntent(parent);
        }
        return this;
    }
/**
     * Add the activity parent chain as specified by manifest &lt;meta-data&gt; elements
     * to the task stack builder.
     *
     * @param sourceActivity All parents of this activity will be added
     * @return This TaskStackBuilder for method chaining
     */
Add the activity parent chain as specified by manifest <meta-data> elements
to the task stack builder.

@param sourceActivity All parents of this activity will be added
@return This TaskStackBuilder for method chaining
Add the activity parent chain as specified by manifest <meta - data > elements to the task stack builder . @param sourceActivity All parents of this activity will be added @return This TaskStackBuilder for method chaining
@NonNull
    public TaskStackBuilder addParentStack(@NonNull Activity sourceActivity) {
        Intent parent = null;
        if (sourceActivity instanceof SupportParentable) {
            parent = ((SupportParentable) sourceActivity).getSupportParentActivityIntent();
        }
        if (parent == null) {
            parent = NavUtils.getParentActivityIntent(sourceActivity);
        }
        if (parent != null) {
            ComponentName target = parent.getComponent();
            if (target == null) {
                target = parent.resolveActivity(mSourceContext.getPackageManager());
            }
            addParentStack(target);
            addNextIntent(parent);
        }
        return this;
    }
@ NonNull public TaskStackBuilder addParentStack ( @ NonNull Activity sourceActivity ) { Intent parent = null ; if ( sourceActivity instanceof SupportParentable ) { parent = ( ( SupportParentable ) sourceActivity ) . getSupportParentActivityIntent ( ) ; } if ( parent == null ) { parent = NavUtils . getParentActivityIntent ( sourceActivity ) ; } if ( parent != null ) { ComponentName target = parent . getComponent ( ) ; if ( target == null ) { target = parent . resolveActivity ( mSourceContext . getPackageManager ( ) ) ; } addParentStack ( target ) ; addNextIntent ( parent ) ; } return this ; }
Add the activity parent chain as specified by manifest &lt;meta-data&gt; elements
 to the task stack builder.
Add the activity parent chain as specified by manifest &lt ; meta - data&gt ; elements to the task stack builder .
// We have the actual parent intent, build the rest from static metadata // then add the direct parent intent to the end.