共用方式為


MemoryFile.AllowPurging(Boolean) 方法

定義

啟用或停用記憶體檔案清除。

[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

參數

allowPurging
Boolean

如果操作系統可以在記憶體不足的情況下清除檔案的內容,則為 true

傳回

allowPurging 先前的值

屬性

例外狀況

備註

啟用或停用記憶體檔案清除。

已取代這個成員。 Purgable 被認為是一般脆弱,很難安全地使用。 建議改用 android.content.ComponentCallbacks2#onTrimMemory(int) 應用程式來回應記憶體事件,並視需要釋放共用記憶體區域。

android.os.MemoryFile.allowPurging(boolean)Java 檔。

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於