I am trying to prevent the android back button from going back on a certain page of my application. Everywhere online suggest the code below, however it is not working. I put a breakpoint in the 'backbutton' event listener, it hits it just fine. However the app still goes back a page.
I am using Ionic on top of Cordova(4.0.0). I am testing it using an Android(4.4.2) emulator.
Any Thoughts?
Here is the code I am using.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
document.addEventListener("backbutton", function (e) {
e.preventDefault();
}, false );
}