I did not mean to imply that the termination process called onPause() - merely that I can safely assume that onPause will be called previous to process termination - except as you note, in exceptional circumstances (note that a phone shutdown appears to be one of these exceptional circumstances).
BTW, I've replaced SharedPreferences with a simple Properties object which I manually save to a local file, and I have not, as of yet, been able induce the application to loose it's settings. Being very paranoid, I even save the Properties object to a temp file, and then copy the file over the main preferences file, hoping that the copy operation is native and atomic enough that, even in the event of abnormal process termination, the copy will either succeed and replace the original file, or fail and leave the original file intact. On Dec 1, 1:19 pm, "Dianne Hackborn" <[EMAIL PROTECTED]> wrote: > There is nothing called "before the process is terminated," if you are > thinking of it as "the system thinks it needs to kill something, so politely > asks it to get ready and then kills it." What actually happens it that > onPause is called when the system is going to put the process in a > background state, and from there at whatever point the system needs to get > rid of the process it will just kill it, no questions asked. > > While onPause() is running, the process is in a foreground state, so it will > not be killed unless the system is so low on memory it needs to kill that > process to continue to have memory for the core system processes... which > should only happen if the app is just using all of the available memory so > that not even background things can run. Basically never for non-buggy > apps. > > However, your process can get killed if you are installing an update to it, > because the first thing the system does is cleanup and kill all existing > code of the process before installing the update. We should probably do > something to make this a little more clean for users installing updates. > And this same thing happens every time you run your app from eclipse, since > all it is really doing is telling the system to update to your current > version of the app. > > -- > Dianne Hackborn > Android framework engineer > [EMAIL PROTECTED] > > Note: please don't send private questions to me, as I don't have time to > provide private support. All such questions should be posted on public > forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

