question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

backbutton event not working using quasar dev in cordova mode with android 5.1

See original GitHub issue

When using debug version(quasar dev -m cordova -T android) with an android 5.1 phone, I can not register backbutton event using following code

mounted () {
    if (this.$q.platform.is.cordova) {
      document.addEventListener('backbutton', this.onBackButton, false)
    }
}

onBackButton method never get fired when I pressed the back button, but in quasar release version or change a phone with android 7.0, it’s ok.

Software version

Operating System Windows_NT(6.3.9600) - win32/x64 NodeJs 8.11.2

Global packages NPM 5.6.0 yarn 1.7.0 quasar-cli 0.16.4 vue-cli 2.9.6 cordova 8.0.0 quasar-cli 0.16.4
quasar-framework 0.16.0
quasar-extras 2.0.2
vue 2.5.16
vue-router 3.0.1
vuex 3.0.1

What did you get as the error?

onBackButton method never get fired

What were you expecting?

onBackButton method should be triggered when I press back button

What steps did you take, to get the error?

  • just using quasar starter kit
  • add the backbutton event callback
  • using quasar dev -m cordova -T android with an android 5.1 phone

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
anandtripathi5commented, Oct 4, 2020

Its solved in 7827 issue.

0reactions
anandtripathi5commented, Oct 2, 2020

@hawkeye64 Please check on deviceready event I have added deviceReady function and on backbutton event I have added onKeyDown function

I don’t know what I’m missing. onKeyDown function is never being called cause there are no logs in the console

I guess you are confused with the function name onKeyDown, let’s change the function name to onBackButton

Read more comments on GitHub >

github_iconTop Results From Across the Web

back button in android using Quasar 0.16
When using debug version(quasar dev -m cordova -T android), the back button works as expected, but I can not register backbutton event using...
Read more >
Cordova Troubleshooting and Tips - Quasar Framework
While you are developing a Mobile App with Cordova Mode, you can access $q.cordova in your Vue files. This is an alias to...
Read more >
prevent backbutton goback to previous page without ...
I am using the Quasar CLI version 0.15.20 which has the dialog $q.dialog for confirmation. I want to control the backbutton on android...
Read more >
cordova-plugin-splashscreen
cordova -plugin-splashscreen · Installation · Supported Platforms · Platform Splash Screen Image Configuration. Example Configuration; Android-specific Information.
Read more >
cordova - 掘金
cd hello cordova platform add ios cordova platform add android cordova ... API or to native plugins that go through Objective-C do not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found