This sounds like an Android anti-pattern. I would suggest you design your app so that is does not need a "do you want to quit".
1) onDestroy is not guaranteed to be called. 2) end-users do not expect apps to ask them I they should quit. On Tuesday, November 27, 2012 9:15:36 PM UTC, Subodh Nijsure wrote: > > Hi, > > 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? > > -Subodh > -- 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