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 .
