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.

Hardware back button does not work on device

See original GitHub issue

Tried capacitor for first time today and built the app successfully. But hardware back button does not work on device.

Back button on navbar works.

Steps I followed:

  1. ionic start capacitorApp sidemenu
  2. npm install --save @capacitor/cli @capacitor/core
  3. npm uninstall --save cordova-plugin-splashscreen
  4. npm run build
  5. npx cap add android
  6. npx cap open android
  7. run app with android studio

On hitting hardware back button app does exit, but page navigation does not work.

Capacitor Info:

   Capacitor Doctor

Dependencies:

  @capacitor/cli: 1.0.0-alpha.32

  @capacitor/core: 1.0.0-alpha.32

  Capacitor Android: not installed

[success] Android looking great! 👌

Ionic Info:


cli packages: (C:\Users\nquser\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

local packages:

    @ionic/app-scripts : 3.1.8
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v8.9.4
    npm  : 3.7.3
    OS   : Windows 10

Misc:

    backend : legacy

Device : MiA1(Android 8.1.0)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mlynchcommented, Mar 31, 2018

We’re not emitting the backbutton event that Cordova did that Ionic relies on, we can fix that

0reactions
ionitron-bot[bot]commented, Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hardware Back Button for Capacitor & Cordova on Android ...
The hardware back button is found on most Android devices. In native applications it can be used to close modals, navigate to the...
Read more >
How To Fix Back Button Not Working on iPhone and Android
Restart the Device · Check for a System Update · Wiping the System Cache Partition · Use a Third-party Back Button App ·...
Read more >
My Hardware 'Back Button Action' is not working in Ionic 4
I think the problem is in my ( outlet && outlet.canGoBack()) because this is not working. I am using the tab theme and...
Read more >
How To Enable The BACK Button On Your Android ... - YouTube
How To get The BACK Button On Your Android Phone Quickly & Easily if the navigation buttons are ... Your browser can't play...
Read more >
In Android Application, Device Back Button Does Not Work
In Android Application, Device Back Button Does Not Work (Doc ID 2727130.1) · 1. Login with a retailer/corporate user · 2. Navigate to...
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