Skip to content

Back button not working/bug #42

@hereforhelp

Description

@hereforhelp

The back button event listener is not working after adding webview-plus plugin for android.

Steps to reproduce:

  1. cocoonjs create backbuttontest

  2. cd backbuttontest

  3. cocoonjs platform add android

  4. cocoonjs plugin add com.ludei.webview.plus

  5. Edit www/js/index.js, add "document.addEventListener('backbutton', function(){alert("Back Button Pressed!");});" into onDeviceReady function so that it looks like this:

onDeviceReady: function() {
app.receivedEvent('deviceready');
document.addEventListener('backbutton', function(){alert("Back Button Pressed!");});
},

  1. cocoonjs run android

When the app is launched, press the back button and the app will exit without triggering the event listener.
However, if you launch the app, press the home button (to bring it to background), open the app again (from background), press the back button and the event listener will get triggered.

Am I doing something wrong or what?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions