compat/src/main/java/androidx/core/app/TaskStackBuilder.java
@NonNull
    public TaskStackBuilder addNextIntentWithParentStack(@NonNull Intent nextIntent) {
        ComponentName target = nextIntent.getComponent();
        if (target == null) {
            target = nextIntent.resolveActivity(mSourceContext.getPackageManager());
        }
        if (target != null) {
            addParentStack(target);
        }
        addNextIntent(nextIntent);
        return this;
    }
/**
     * Add a new Intent with the resolved chain of parents for the target activity to
     * the task stack.
     *
     * <p>This is equivalent to calling {@link #addParentStack(ComponentName) addParentStack}
     * with the resolved ComponentName of nextIntent (if it can be resolved), followed by
     * {@link #addNextIntent(Intent) addNextIntent} with nextIntent.</p>
     *
     * @param nextIntent Intent for the topmost Activity in the synthesized task stack.
     *                   Its chain of parents as specified in the manifest will be added.
     * @return This TaskStackBuilder for method chaining.
     */
Add a new Intent with the resolved chain of parents for the target activity to
the task stack.

This is equivalent to calling  #addParentStack(ComponentName) addParentStack
with the resolved ComponentName of nextIntent (if it can be resolved), followed by
#addNextIntent(Intent) addNextIntent with nextIntent.

@param nextIntent Intent for the topmost Activity in the synthesized task stack.
Its chain of parents as specified in the manifest will be added.
@return This TaskStackBuilder for method chaining.
Add a new Intent with the resolved chain of parents for the target activity to the task stack . This is equivalent to calling #addParentStack ( ComponentName ) addParentStack with the resolved ComponentName of nextIntent ( if it can be resolved ) followed by #addNextIntent ( Intent ) addNextIntent with nextIntent . @param nextIntent Intent for the topmost Activity in the synthesized task stack . Its chain of parents as specified in the manifest will be added . @return This TaskStackBuilder for method chaining .
@NonNull
    public TaskStackBuilder addNextIntentWithParentStack(@NonNull Intent nextIntent) {
        ComponentName target = nextIntent.getComponent();
        if (target == null) {
            target = nextIntent.resolveActivity(mSourceContext.getPackageManager());
        }
        if (target != null) {
            addParentStack(target);
        }
        addNextIntent(nextIntent);
        return this;
    }
@ NonNull public TaskStackBuilder addNextIntentWithParentStack ( @ NonNull Intent nextIntent ) { ComponentName target = nextIntent . getComponent ( ) ; if ( target == null ) { target = nextIntent . resolveActivity ( mSourceContext . getPackageManager ( ) ) ; } if ( target != null ) { addParentStack ( target ) ; } addNextIntent ( nextIntent ) ; return this ; }
Add a new Intent with the resolved chain of parents for the target activity to
 the task stack.
Add a new Intent with the resolved chain of parents for the target activity to the task stack .