January 2012
Intermediate to advanced
282 pages
7h 4m
English
Your application is not alone. It has to share resources with many other applications and also the system as a whole. Consequently, there may be times when there is not enough memory for everyone and in this case, Android will ask applications and applications' components (such as activities or fragments) to tighten their belts.
The ComponentCallbacks interface defines the onLowMemory() API, which is common to all application components. When it is called, a component is basically asked to release objects it does not really need. Typically, your implementation of onLowMemory() would release: