What is the onTrimMemory method?
What is the onTrimMemory method?
The onTrimMemory method is a callback in Android that notifies your app when the system is running low on memory and your app should release resources to improve system performance. It is part of the ComponentCallbacks2 interface, which extends the ComponentCallbacks interface with additional callbacks for finer-grained memory management.
The onTrimMemory method is called with a level parameter that indicates the memory situation and how much memory your app should try to free. The levels range from TRIM_MEMORY_RUNNING_MODERATE when the device is beginning to run low on memory, to TRIM_MEMORY_COMPLETE when your app's process is nearing the end of the background LRU list and will likely be killed soon if more memory isn't freed.
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.