I am developing an Android application using Phonegap that interacts with my Drupal site. I have re-assigned the Android \"Back\" button to prompt the user to log off from t
document.addEventListener("backbutton", function(e){
if($.mobile.activePage.is('#login_page')){
e.preventDefault();
}
else {
if (confirm("Are you sure you want to logout?")) {
/* Here is where my AJAX code for logging off goes */
}
else {
return false;
}
}
}, false);