Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
2.9.0, 3.0.0
-
None
-
Compiled in Fedora 17, tested on Android 4.2 LG Optimus G and Galaxy Note 2
Description
Steps to reproduce
- Download the latest release of cordova
- Create a new cordova proyect for android with the create script
- Replace the contents of assets/www/index.html with:
index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Cordova Menu Button Example</title> <!-- From: http://docs.phonegap.com/en/3.0.0/cordova_events_events.md.html#menubutton --> <script type="text/javascript" charset="utf-8" src="cordova.js"></script> <script type="text/javascript" charset="utf-8"> function onLoad() { document.addEventListener("deviceready", onDeviceReady, false); } function onDeviceReady() { document.addEventListener("menubutton", onMenuKeyDown, false); document.addEventListener("click", onTap, false); } function onMenuKeyDown(e) { alert("menu: "+e); } function onTap(e) { alert("click: "+e); } </script> </head> <body onload="onLoad()"> </body> </html>
- Build and install to an Android device
- Press menu and press ok on the alert several times
Expected behavior
The alert("menu") should show up every time menu is pressed
Actual Result
The alert shows up like this:
- menu press: It is displayed
- menu press: It is displayed
- menu press: It is not displayed
- menu press: It is displayed
- menu press: It is not displayed
and so on.
Another way to reproduce:
- Run the previous cordova application on Android
- Press menu and press ok on the alert twice
- swipe the screen
- Press menu (the alert is displayed)
- swipe the screen
- Press menu (the alert is displayed)
- swipe the screen
- Press menu (the alert is displayed)
and so on.... - Press menu (the alert is displayed)
- Tap the screen (the alert("click") is not displayed)
- Press menu (the alert is displayed)
- Tap the screen (the alert("click") is not displayed)
and so on...
Final thoughts
When the menu button is pressed the next event is ignored.
thanks.