Kristopher Micinski wrote: > The application never "quits," and so onDestroy() won't be called when the > user pushes the back button (it will be called when Android kicks your > process out of memory). Instead you would want to override onPause coming > from a press of the back button. > > A better solution would be to realize that the application simply doesn't > quit, so asking the user if they're sure they want to quit is silly: since > this won't happen even if they push the back button... > > > Subodh Nijsure <subodh....@gmail.com <javascript:>> wrote: > >> I want to present a yes/no dialog when user enters back, on main activity >> 'are you sure you want to quit? ' And if they click ok, quit the >> application. >> >> To do this I show a dialog in onDestroy() that asks yes/no question but >> that doesn't work. What is correct way to implement 'are you sure you want >> to quit the application' dialog? >> > Alan Cooper's _About Face: The Essentials of User Interface Design_ compares a program that incessantly asks what it ought to know to a human secretary, and points out that you'd terminate a human (with extreme prejudice) who behaved like a computer program.
Paraphrasing: You: "Give me that document from yesterday." Comp: "What's the name of that document?" You: "Name? I don't know - the one you and I were working on!" Comp: "I need the name." You: "Name ... name ... ah, here it is - 'MyMemo.doc'." Comp: "OK, I'll get it for you. Where'd we store it?" etc. If I tell you I want to quit (assuming such a thing is possible), I don't expect you to nag, "Are you really, really sure you really, really want to quit, really?" -- Lew -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en