In my Android phonegap/Cordova 3.5 project, I have 3 html pages (a button in index.html calls page2.html where there is another button calling page3.html).
In page2.html I override backbutton doing this in deviceReady:
document.addEventListener("backbutton", onBackKeyDown, false);
then
function onBackKeyDown() {
console.log("onBackKeyDown");
navigator.app.exitApp();
}
but in page3.html I want to let Android controlling backbutton so I do not override it in page3.html. Instead in page3.html backbutton is disabled.
Questions:
- Is this the expected behaviour (overriding one means overriding for ever)?
- How to get rid with this? (leave the control of backbutton to Android anytime I want to)