Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-16053

Aerogear: backbutton listener doesn't work on the android device

    XMLWordPrintable

Details

    • released to 4.1.1 branch

    Description

      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

      Attachments

        Activity

          People

            gercan@redhat.com Gorkem Ercan
            ibuziuk@redhat.com Ilya Buziuk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: