compat/src/main/java/androidx/core/app/TaskStackBuilder.java
public TaskStackBuilder addParentStack(ComponentName sourceActivityName) {
        final int insertAt = mIntents.size();
        try {
            Intent parent = NavUtils.getParentActivityIntent(mSourceContext, sourceActivityName);
            while (parent != null) {
                mIntents.add(insertAt, parent);
                parent = NavUtils.getParentActivityIntent(mSourceContext, parent.getComponent());
            }
        } catch (NameNotFoundException e) {
            Log.e(TAG, "Bad ComponentName while traversing activity parent metadata");
            throw new IllegalArgumentException(e);
        }
        return this;
    }
/**
     * Add the activity parent chain as specified by manifest &lt;meta-data&gt; elements
     * to the task stack builder.
     *
     * @param sourceActivityName Must specify an Activity component. 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 sourceActivityName Must specify an Activity component. 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 sourceActivityName Must specify an Activity component . All parents of this activity will be added @return This TaskStackBuilder for method chaining
public TaskStackBuilder addParentStack(ComponentName sourceActivityName) {
        final int insertAt = mIntents.size();
        try {
            Intent parent = NavUtils.getParentActivityIntent(mSourceContext, sourceActivityName);
            while (parent != null) {
                mIntents.add(insertAt, parent);
                parent = NavUtils.getParentActivityIntent(mSourceContext, parent.getComponent());
            }
        } catch (NameNotFoundException e) {
            Log.e(TAG, "Bad ComponentName while traversing activity parent metadata");
            throw new IllegalArgumentException(e);
        }
        return this;
    }
public TaskStackBuilder addParentStack ( ComponentName sourceActivityName ) { final int insertAt = mIntents . size ( ) ; try { Intent parent = NavUtils . getParentActivityIntent ( mSourceContext , sourceActivityName ) ; while ( parent != null ) { mIntents . add ( insertAt , parent ) ; parent = NavUtils . getParentActivityIntent ( mSourceContext , parent . getComponent ( ) ) ; } } catch ( NameNotFoundException e ) { Log . e ( TAG , "Bad ComponentName while traversing activity parent metadata" ) ; throw new IllegalArgumentException ( e ) ; } 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 .