Hi all,
I’ve made several post about this issue before and googled the hell out of it but cannot find an answer. Believe it could be a bug.
Issue (EDITED): I’m pushing a page onto the nav stack and the auto generated back button in the navbar does not work on android.
Or to put it another way, when I’m using the app - I’m on the home page, hit the side menu button and select a link on the side menu to go to another page. Here the page opens but the back button (on android) will not go back to the home page.
In my example it start from the sidemenu --v2 starter template.
app.component.ts
import { Component, ViewChild, } from '@angular/core';
import { Nav, Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { HomePage } from '../pages/home/home';
import { ListPage } from '../pages/list/list';
@Component({
templateUrl: 'app.html',
})
export class MyApp {
@ViewChild(Nav) nav: Nav;
rootPage: any = HomePage;
listPage = ListPage;
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
this.initializeApp();
}
initializeApp() {
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
this.statusBar.styleDefault();
this.splashScreen.hide();
});
}
openPage(page) {
this.nav.push(page).catch(() => {
console.log("Unable to load page");
})
}
}
app.html
<ion-menu type="overlay" [content]="content">
<ion-content>
<ion-list>
<button menuClose ion-item detail-none (click)="openPage(listPage)">
My Trips
</button>
</ion-list>
</ion-content>
</ion-menu>
<!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
<ion-nav [root]="rootPage" #content swipeBackEnabled="true"></ion-nav>
End up with a back button on the opened page that does nothing, but as said works on ios.
Thanks