共用方式為


Activity.ReleaseInstance Method

Definition

Ask that the local app instance of this activity be released to free up its memory.

[Android.Runtime.Register("releaseInstance", "()Z", "GetReleaseInstanceHandler")]
public virtual bool ReleaseInstance ();
[<Android.Runtime.Register("releaseInstance", "()Z", "GetReleaseInstanceHandler")>]
abstract member ReleaseInstance : unit -> bool
override this.ReleaseInstance : unit -> bool

Returns

Returns true if the activity was in a state that it has started the process of destroying its current instance; returns false if for any reason this could not be done: it is currently visible to the user, it is already being destroyed, it is being finished, it hasn't yet saved its state, etc.

Attributes

Remarks

Ask that the local app instance of this activity be released to free up its memory. This is asking for the activity to be destroyed, but does <b>not</b> finish the activity -- a new instance of the activity will later be re-created if needed due to the user navigating back to it.

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

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