Udostępnij za pośrednictwem


Activity.NavigateUpTo(Intent) Method

Definition

Navigate from this activity to the activity specified by upIntent, finishing this activity in the process.

[Android.Runtime.Register("navigateUpTo", "(Landroid/content/Intent;)Z", "GetNavigateUpTo_Landroid_content_Intent_Handler")]
public virtual bool NavigateUpTo (Android.Content.Intent? upIntent);
[<Android.Runtime.Register("navigateUpTo", "(Landroid/content/Intent;)Z", "GetNavigateUpTo_Landroid_content_Intent_Handler")>]
abstract member NavigateUpTo : Android.Content.Intent -> bool
override this.NavigateUpTo : Android.Content.Intent -> bool

Parameters

upIntent
Intent

An intent representing the target destination for up navigation

Returns

true if up navigation successfully reached the activity indicated by upIntent and upIntent was delivered to it. false if an instance of the indicated activity could not be found and this activity was simply finished normally.

Attributes

Remarks

Navigate from this activity to the activity specified by upIntent, finishing this activity in the process. If the activity indicated by upIntent already exists in the task's history, this activity and all others before the indicated activity in the history stack will be finished.

If the indicated activity does not appear in the history stack, this will finish each activity in this task until the root activity of the task is reached, resulting in an "in-app home" behavior. This can be useful in apps with a complex navigation hierarchy when an activity may be reached by a path not passing through a canonical parent activity.

This method should be used when performing up navigation from within the same task as the destination. If up navigation should cross tasks in some cases, see #shouldUpRecreateTask(Intent).

Java documentation for android.app.Activity.navigateUpTo(android.content.Intent).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to