cordova back button fires event listener but app closes anyway
问题 I have the following code where if the user presses back button on his device, I want to show him a popup before he is able to exit the app. However, this does not work for me. The alert box is showed but the app also closes. document.addEventListener("deviceready", function() { document.addEventListener("backbutton", function(e) { e.preventDefault(); $scope.alertDialog.show(); }, false); }, false); Cordova version:6.4.0 And before someone brings it out - cordova.js is included in the index