Quote:
Originally Posted by cybmole
technically - does CC actually "close" in android or is is an open in background process
|
Rather hard to answer this question because of the way Android manages processes.
An Android app does not ever "close" in the sense that it says "I am done. Kill my process." Instead it says "I have nothing more to do. You can kill me if you want." Android reserves the right to kill any process at any time. Depending on memory, the process an app is running within can be killed when the app is put into the background. Or not killed. The app is not told if it is going to be killed.
An app consists of a set of things called "activities". An activity can be (loosely) thought of as a unit of functionality. When an activity is put into the background, perhaps because it started some other activity (think CC book list to CC book details), then the calling activity is asked to save its state. At this point the process for that activity may or may not be killed. If the activity is brought back to the foreground then if the process had been killed the activity is re-created and the state is restored. If the process had not been killed then the re-create step is not done before the state is restored. This can lead to all sorts of subtle bugs because sometimes on restart the local variables (class attributes) still exist and sometimes they do not.
To get directly to your question: if the only activity for an app says "I am done" and gives control back to the OS then my experience is that Android will kill that app's process. No state will be saved by Android (the app might save state itself). If the activity comes back then the app will be reinitialized as if it is starting after a boot. It isn't strictly required in this case that the process be killed, but I have never seen a case where it is not.