On Mar 31, 1:38 pm, Peli <[EMAIL PROTECTED]> wrote: > If the design philosophy is "save on back", then why does this default > to > RESULT_CANCELED?
Activities only return results when the caller is asking for something -- typically the user picking an item like a contact, a media file, etc. When you are saving your data you are storing it in a content provider, not returning it as a result. > My workaround is to call "finish()" in the "onPause()" method, right > after "setResult(...)". You almost certainly don't want to always call finish() in onPause(), you can be paused for many reasons: the user pressing the home button, the device going to sleep, etc. The key thing is that while being paused, you need to have your state saved away so it can be recovered if the process has to be killed and your activity later restarted. This is one of the motivations for using an edit-in-place model, in addition to the fact that the user can easily be distracted from your applications (by a phone call for example) and not return any time soon to what they were doing. Typically this can be handled by either writing the data so far, or storing a "draft" record that the user can go back and complete (for example if composing an e-mail). --~--~---------~--~----~------------~-------~--~----~ 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] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

