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.

ionic tabs project can't backstack correctly in android

See original GitHub issue

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

After running tabs project on android, I click tab1 -> tab2 -> tab3, and then click back key, and page changed to tab3 -> tab2 -> tab1.

Expected Behavior

But the expected is that when l click back key, don’t change to previous tab, and when I click twice back keys, app return to device home. I had read Hardware Back Button, and I added it on app.component.ts, but it doesn’t work. And googlging for this, I saw this issue, but there isn’t useful ways.

Steps to Reproduce

The code simple repo is here, it’s same as the origin tabs project. Thx for any suggestions.

Code Reproduction URL

https://github.com/lcy19/tabs-demohttps://github.com/lcy19/tabs-demo

Ionic Info

Ionic:

Ionic CLI : 6.19.1 (C:\Users\lcy\AppData\Roaming\npm\node_modules@ionic\cli) Ionic Framework : @ionic/angular 6.1.8 @angular-devkit/build-angular : 13.2.6 @angular-devkit/schematics : 13.2.6 @angular/cli : 13.2.6 @ionic/angular-toolkit : 6.1.0

Cordova:

Cordova CLI : 11.0.0 Cordova Platforms : android 9.1.0 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 3 other plugins)

Utility:

cordova-res : 0.15.4 native-run : 1.6.0

System:

Android SDK Tools : 26.1.1 (C:\Users\lcy\AppData\Local\Android\Sdk) NodeJS : v16.14.2 (D:\programs\nodejs\node.exe) npm : 8.5.0 OS : Windows 10

Additional Information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lcy19commented, Jun 8, 2022

Thanks for your advice! I’ll try it.

0reactions
ionitron-bot[bot]commented, Jul 8, 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 Ionic, 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

ionic 3 tabs hardware back button won't exit - Stack Overflow
@MohanGopi my issue is that it never closes once the stack is empty. The back button does nothing once I'm on the tab...
Read more >
NavController - Ionic API Documentation
NavController is the base class for navigation controller components like Nav and Tab . You use navigation controllers to navigate to pages in...
Read more >
Angularjs – Responsive Image on ionic Tab bar - iTecNote
I am using Ionic for my project and I got a problem with Tab bar. ... Android – Separate Back Stack for each...
Read more >
Navigation - Android Developers
As you navigate through your app, you tell the NavController that you want to navigate either along a specific path in your navigation...
Read more >
Declare restricted screen support - Android Developers
For example, if you want to publish both a handset version and a tablet version of your app, but you're unable to make...
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