I noticed that after I quit an app using the back button, when I go to the “Manage apps” menu I still have an option “Force Stop”. Shouldn’t the app be already dead at this point? (I made sure that OnDestroy indeed runs).
Why would I have an option to force stop an app that’s officially dead?
Thanks,
Geva Tal.
Using the
BACKbutton finishes anActivity, i.e., the current UI part of an ‘app’.A common mistake is to assume that an
Activityis the entire ‘app’ which is not necessarily the case. As CommonsWare points out, it is not necessary for the OS to immediately clean up all of the parts related to the process in which anActivityruns – in fact it can be counter-intuitive if a user briefly leaves anActivitybut then re-visits it shortly after.Android is actually very efficient at managing resources and releasing them (if needed for other ‘apps’). What gets retained / maintained after a particular
Activityfinishes isn’t worth worrying about…or at least it shouldn’t be if the developer has correctly cleaned up things in their code.Part of the culture of ‘App Killer’ apps is related to people assuming that apps don’t clean up properly when an
Activityfinishes. If written correctly, they do and Android will do the rest if/when necessary.