So, this question has been asked in many forms on this forum but none of the answers are helping me. I have a bug which I\'ve only been able to reproduce on the Samsung Gal
Android can call the destroy() method in certain scenarios. One is when we use the method finish(). An alternative is to use the method isFinishing () from Activity class. If it really is being finalized could finalize their resources, otherwise, you can keep the values allocated a class that inherits Application
@Override
protected void onDestroy() {
final YourApp app = (YourApp) getApplicationContext();
if (app != null && isFinishing()) {
app.finalizeAppResources();
}
// ...
super.onDestroy();
}