v4: Android hardware back button doesn't work
See original GitHub issueBug Report
Ionic Info
Run ionic info from a terminal/cmd prompt and paste the output below.
Ionic:
ionic (Ionic CLI) : 4.0.0-rc.9 (C:\Users\ape\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.0.0-alpha.7
@angular-devkit/core : 0.6.8
@angular-devkit/schematics : 0.6.8
@angular/cli : 6.0.8
@ionic/ng-toolkit : not installed
@ionic/schematics-angular : 1.0.0-rc.9
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 6.3.0 ios 4.5.4
System:
Android SDK Tools : 25.2.5
NodeJS : v10.5.0 (C:\Program Files\nodejs\node.exe)
npm : 6.1.0
OS : Windows 10
Describe the Bug Android hardware button doesn’t work as intended. It seems to be because of back button behavior overriding in generated cordova.js:
var backButtonChannel = cordova.addDocumentEventHandler('backbutton');
backButtonChannel.onHasSubscribersChange = function() {
// If we just attached the first handler or detached the last handler,
// let native know we need to override the back button.
exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [this.numHandlers == 1]);
};
which is caused by:
Steps to Reproduce Steps to reproduce the behavior:
- Clone repo https://github.com/ionictheme/ionic4-start-theme
- Install deps and run on device
- Click on android hardware back button
- Nothing happens
Expected Behavior Android hardware back button should return the previous page or exit app.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:19 (2 by maintainers)
Top Results From Across the Web
v4: Android hardware back button doesn't work · Issue #14803
I have to tap it twice in order for doit() to be called. It does not happen, when I got back with the...
Read more >Hardware back button doesn't the app on Android with Ionic 4
I am facing problem with the hardware back button on android. I am working with Ionic CLI 4.12.0 I want to exit the...
Read more >On screen back button not working - XDA Forums
Go to google settings and reset ! The BACK button will work again!
Read more >Android Home Back Button keys Not Working Damaged
This video will help onhow to solve android Back key Home key, Menu key, recent button not working problemHow to enable soft-keys navigation ......
Read more >How To Bring Back The Android Back Button [Back ... - YouTube
There is no Back Button, Home Button, and Switch Apps Button on your Android Phone Screen, and you want to bring them back?...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

this.platform.exitApp();doesn’t work for ionic v4.1.2@manucorporat PR https://github.com/ionic-team/ionic/pull/15615 fixes the remaining problem with the handler registered by
overlays.tsx.