Share via


MemoryFile.AllowPurging(Boolean) Method

Definition

Enables or disables purging of the memory file.

[Android.Runtime.Register("allowPurging", "(Z)Z", "GetAllowPurging_ZHandler")]
public virtual bool AllowPurging (bool allowPurging);
[<Android.Runtime.Register("allowPurging", "(Z)Z", "GetAllowPurging_ZHandler")>]
abstract member AllowPurging : bool -> bool
override this.AllowPurging : bool -> bool

Parameters

allowPurging
Boolean

true if the operating system can purge the contents of the file in low memory situations

Returns

previous value of allowPurging

Attributes

Exceptions

Remarks

Enables or disables purging of the memory file.

This member is deprecated. Purgable is considered generally fragile and hard to use safely. Applications are recommend to instead use android.content.ComponentCallbacks2#onTrimMemory(int) to react to memory events and release shared memory regions as appropriate.

Java documentation for android.os.MemoryFile.allowPurging(boolean).

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