I used backKeyDownand it works for me:
function onDeviceReady() {
document.addEventListener("backbutton", backKeyDown, true);
console.log("PhoneGap is ready");
}
function backKeyDown(d) {
navigator.app.exitApp();
e.preventDefault();
}
make sure that PhoneGap is ready!
Update: You can leave the handler empty until you disable it.
source
share