I am developing an app using phonegap-1.3.0 and android-4.0.3.Below is my code :

```
function home() {   
document.removeEventListener("backbutton", handleBackButton, false);
document.addEventListener("backbutton", handleBackButtonOnHome, false);
}

function edit() {
document.removeEventListener("backbutton", handleBackButtonOnHome, false);   document.addEventListener("backbutton", handleBackButton, false);
}

function handleBackButton() {
console.log("Back Button Pressed!");
home();
}

function handleBackButtonOnHome() {
console.log("Back Button Pressed in home!");
navigator.app.exitApp();
}

```

On click of hardware back button on edit page takes the user to the home page and when on home page the app exits as specified by the event handlers. The app is working fine on the specified setup (configuration).

Recently I upgraded to cordova-2.1.0, on click of back button on edit page exits the app instead of taking the user to the home page.

Please note : I have tried my thing but nothing seems to work,  

`navigator.app.backHistory()`  

`history.back()`

Any help welcome..