-
Notifications
You must be signed in to change notification settings - Fork 17
Description
The back button event listener is not working after adding webview-plus plugin for android.
Steps to reproduce:
-
cocoonjs create backbuttontest
-
cd backbuttontest
-
cocoonjs platform add android
-
cocoonjs plugin add com.ludei.webview.plus
-
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!");});
},
- 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?