ContentProvider.OnLowMemory Method

Definition

This is called when the overall system is running low on memory, and actively running processes should trim their memory usage. While the exact point at which this will be called is not defined, generally it will happen when all background process have been killed. That is, before reaching the point of killing processes hosting service and foreground UI that we would like to avoid killing. This method is always called on the application main thread, and must not perform lengthy operations. The default content provider implementation does nothing. Subclasses may override this method to take appropriate action.

[Android.Runtime.Register("onLowMemory", "()V", "GetOnLowMemoryHandler")]
public virtual void OnLowMemory();
[<Android.Runtime.Register("onLowMemory", "()V", "GetOnLowMemoryHandler")>]
abstract member OnLowMemory : unit -> unit
override this.OnLowMemory : unit -> unit

Implements

Attributes

Remarks

This is called when the overall system is running low on memory, and actively running processes should trim their memory usage. While the exact point at which this will be called is not defined, generally it will happen when all background process have been killed. That is, before reaching the point of killing processes hosting service and foreground UI that we would like to avoid killing. This method is always called on the application main thread, and must not perform lengthy operations. The default content provider implementation does nothing. Subclasses may override this method to take appropriate action.

Java documentation for android.content.ContentProvider.onLowMemory().

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