語言

IComponentCallbacks.OnLowMemory 方法

定義

當整體系統記憶體不足時,當正在執行的程序應該會修剪記憶體使用時,就會呼叫這個動作。

[Android.Runtime.Register("onLowMemory", "()V", "GetOnLowMemoryHandler:Android.Content.IComponentCallbacksInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void OnLowMemory();
[<Android.Runtime.Register("onLowMemory", "()V", "GetOnLowMemoryHandler:Android.Content.IComponentCallbacksInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OnLowMemory : unit -> unit
屬性

備註

當整體系統記憶體不足時,當正在執行的程序應該會修剪記憶體使用時,就會呼叫這個動作。 雖然具體何時會被呼叫尚未明確定義,但通常會在所有背景程序終止後進行。 也就是說,在到達終止我們希望避免終止的託管服務和前景介面程序之前。

此會員已被棄用。 自 API 等級 14 起,此功能被 取代 ComponentCallbacks2#onTrimMemory。 自 API 等級 34 起,此功能從未被呼叫。 如果你覆蓋了 ComponentCallbacks2#onTrimMemory,且你的 minSdkVersion 大於 API 14,你可以為此方法提供一個空實作。

Java 文件 android.content.ComponentCallbacks.onLowMemory()。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於