Android Guides | Samples

Android.App.TaskStackBuilder Class

Utility class for constructing synthetic back stacks for cross-task navigation on Android 3.0 and newer.

See Also: TaskStackBuilder

Syntax

[Android.Runtime.Register("android/app/TaskStackBuilder", DoNotGenerateAcw=true)]
public class TaskStackBuilder : Object

Remarks

Utility class for constructing synthetic back stacks for cross-task navigation on Android 3.0 and newer.

About Navigation

For more detailed information about tasks, the back stack, and navigation design guidelines, please read Tasks and Back Stack from the developer guide and Navigation from the design guide.

In API level 11 (Android 3.0/Honeycomb) the recommended conventions for app navigation using the back key changed. The back key's behavior is local to the current task and does not capture navigation across different tasks. Navigating across tasks and easily reaching the previous task is accomplished through the "recents" UI, accessible through the software-provided Recents key on the navigation or system bar. On devices with the older hardware button configuration the recents UI can be accessed with a long press on the Home key.

When crossing from one task stack to another post-Android 3.0, the application should synthesize a back stack/history for the new task so that the user may navigate out of the new task and back to the Launcher by repeated presses of the back key. Back key presses should not navigate across task stacks.

TaskStackBuilder provides a way to obey the correct conventions around cross-task navigation.

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 16

The members of Android.App.TaskStackBuilder are listed below.

See Also: Object

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
IntentCountInt32.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

AddNextIntent(Intent) : TaskStackBuilder
Add a new Intent to the task stack.
AddNextIntentWithParentStack(Intent) : TaskStackBuilder
Add a new Intent with the resolved chain of parents for the target activity to the task stack.
AddParentStack(Activity) : TaskStackBuilder
Add the activity parent chain as specified by the Activity.ParentActivityIntent method of the activity specified and the NoType:android/R$attr;Href=../../../reference/android/R.attr.html#parentActivityName attributes of each successive activity (or activity-alias) element in the application's manifest to the task stack builder.
AddParentStack(ComponentName) : TaskStackBuilder
Add the activity parent chain as specified by the NoType:android/R$attr;Href=../../../reference/android/R.attr.html#parentActivityName attribute of the activity (or activity-alias) element in the application's manifest to the task stack builder.
AddParentStack(Class) : TaskStackBuilder
static
Create(Context) : TaskStackBuilder
Return a new TaskStackBuilder for launching a fresh task stack consisting of a series of activities.
EditIntentAt(Int32) : Intent
Return the intent at the specified index for modification.
GetIntents() : Intent[]
Return an array containing the intents added to this builder.
GetPendingIntent(Int32, PendingIntentFlags) : PendingIntent
Obtain a PendingIntent for launching the task constructed by this builder so far.
GetPendingIntent(Int32, PendingIntentFlags, Bundle) : PendingIntent
Obtain a PendingIntent for launching the task constructed by this builder so far.
StartActivities()
Start the task stack constructed by this builder.
StartActivities(Bundle)
Start the task stack constructed by this builder.