craidencool Posted August 3, 2016 Share Posted August 3, 2016 Hey guys. I am developing a game app in android and whenever I click the phone hardware back button it automatically exits my application. how do I stop or add a function to the back button which asks a question first if he wants to exit or not? Link to comment Share on other sites More sharing options...
Tom Atom Posted August 3, 2016 Share Posted August 3, 2016 Hi, in Cordova this works: document.addEventListener("backbutton", function (e) { e.preventDefault(); if (this.exit) { navigator["app"].exitApp(); } else { console.log("not exiting..."); } }, false); If I am not wrong, intel XDK uses Cordova. plicatibu 1 Link to comment Share on other sites More sharing options...
Recommended Posts