Catch back button and exit PhoneGap application
This article shows an example, how to respond, when user of your mobile application taps on Back
button and how to exit application, after getting user confirmation, that he or she is willing to do so. It also explains, why you shouldn’t do it at all, if you plan to ship your application to multiple platforms, including Apple iOS.