-
Bug
-
Resolution: Done
-
Major
-
None
-
released to 4.1.1 branch
http://docs.phonegap.com/en/3.1.0/cordova_events_events.md.html#backbutton - backbutton event doc
Steps for verifying:
1. Create new Hybrid Mobile Application Project
2. Update index.html with the sample from the documentation:
index.html
<!DOCTYPE html>
<html>
<head>
<title>Back Button Example</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for device API libraries to load
//
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
}
// device APIs are available
//
function onDeviceReady() {
// Register the event listener
document.addEventListener("backbutton", onBackKeyDown, false);
}
// Handle the back button
//
function onBackKeyDown() {
alert(1);
}
</script>
</head>
<body onload="onLoad()">
</body>
</html>
3. Run the app on the android device
4. Press the back button when the app will be ready
5. ERROR: App will be closed - no alert will be shown