Share via


Activity.FinishAffinity Method

Definition

Finish this activity as well as all activities immediately below it in the current task that have the same affinity.

[Android.Runtime.Register("finishAffinity", "()V", "GetFinishAffinityHandler")]
public virtual void FinishAffinity ();
[<Android.Runtime.Register("finishAffinity", "()V", "GetFinishAffinityHandler")>]
abstract member FinishAffinity : unit -> unit
override this.FinishAffinity : unit -> unit
Attributes

Remarks

Finish this activity as well as all activities immediately below it in the current task that have the same affinity. This is typically used when an application can be launched on to another task (such as from an ACTION_VIEW of a content type it understands) and the user has used the up navigation to switch out of the current task and in to its own task. In this case, if the user has navigated down into any other activities of the second application, all of those should be removed from the original task as part of the task switch.

Note that this finish does <em>not</em> allow you to deliver results to the previous activity, and an exception will be thrown if you are trying to do so.

Java documentation for android.app.Activity.finishAffinity().

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