I've create an Application class of my own.
I try to debug it and the code stops at Application.onCreate() but does not stop at onLowMemory.
To test the scenario I open a lot of other high memory applications.
What I see is that the debug session terminated (in eclipse) and some of my static variables turned to null - indicates the the process has ended.
Not only did the debug NOT stop @ the breakpoint of the method, I've put a Log.e(...) line and don't see it as well.
Any idea of why the method was not invoked?
Thanks.
I don't think that there are any guarantees that this method will ever be called.
From the docs:
Since the point at which it is called is not defined, it could choose to never call it.
In general, Android is free to kill your Application whenever it wants, as long as it is in the background. You should only rely on methods in the lifecycle (like onPause, onStop, onDestroy) that specifically state that they are guaranteed to be called in order to do any necessary cleanup.