Example usage for android.app TaskStackBuilder addParentStack

List of usage examples for android.app TaskStackBuilder addParentStack

Introduction

In this page you can find the example usage for android.app TaskStackBuilder addParentStack.

Prototype

public TaskStackBuilder addParentStack(ComponentName sourceActivityName) 

Source Link

Document

Add the activity parent chain as specified by the android.R.attr#parentActivityName parentActivityName attribute of the activity (or activity-alias) element in the application's manifest to the task stack builder.

Usage

From source file:android.app.Activity.java

/**
 * Define the synthetic task stack that will be generated during Up navigation from
 * a different task.//from ww  w  .  ja  v  a2s.  c o  m
 *
 * <p>The default implementation of this method adds the parent chain of this activity
 * as specified in the manifest to the supplied {@link TaskStackBuilder}. Applications
 * may choose to override this method to construct the desired task stack in a different
 * way.</p>
 *
 * <p>This method will be invoked by the default implementation of {@link #onNavigateUp()}
 * if {@link #shouldUpRecreateTask(Intent)} returns true when supplied with the intent
 * returned by {@link #getParentActivityIntent()}.</p>
 *
 * <p>Applications that wish to supply extra Intent parameters to the parent stack defined
 * by the manifest should override {@link #onPrepareNavigateUpTaskStack(TaskStackBuilder)}.</p>
 *
 * @param builder An empty TaskStackBuilder - the application should add intents representing
 *                the desired task stack
 */
public void onCreateNavigateUpTaskStack(TaskStackBuilder builder) {
    builder.addParentStack(this);
}