Implementation
Memory Efficiency,Stability,User Experience
Mobile systems usually have little RAM and no SWAP space to free some memory.
Android provides a mechanism to help the system manage memory. The overrideable method Activity.onLowMemory()
is called 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 should clean caches or unnecessary resources. If this method is not implemented this is considered a smell, due to the fact that it can cause abnormal programm termination.
Memory Efficiency,Stability,User Experience
class MyActivity extends Activity {
...
@Override
public void onLowMemory Efficiency() {
// clean caches and unnecessary ressources
}
}