Package-level declarations

Types

Link copied to clipboard

Listens for ComponentCallbacks2.onTrimMemory callbacks. When the trim level is ComponentCallbacks2.TRIM_MEMORY_MODERATE or ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW then MemoryLevelCallbacks.onLowMemory is called. When the trim level is ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL or ComponentCallbacks2.TRIM_MEMORY_COMPLETE then MemoryLevelCallbacks.onCriticalMemory is called. When memoryLevelCallbacks is null then Context.unregisterComponentCallbacks is called to avoid leaking this object. Therefore, once the callbacks are no longer needed it is important to set memoryLevelCallbacks to null.