Android Mobile back button is not working in ionic 4

how moblie hard button is handle in ionic 4

can you show me your router configuration code and how you navigate between screens ?

backButtonEvent() {

    // close popover
    try {
        const element = await this.popoverCtrl.getTop();
        if (element) {
            element.dismiss();
            return;
        }
    } catch (error) {
    }

    // close modal
    try {
        const element = await this.modalCtrl.getTop();
        if (element) {
            element.dismiss();
            return;
        }
    } catch (error) {

    }

    // // close side menu
    // try {
    //     const element = await this.menu.getOpen();
    //     if (element !== null) {
    //         this.menu.close();
    //         return;

    //     }

    // } catch (error) {

    // }

    this.routerOutlets.forEach((outlet: IonRouterOutlet) => {
        if (this.router.url === '/page1' || this.router.url === '/page2') {
            if (new Date().getTime() - this.lastTimeBackPress < this.timePeriodToExit) {
                navigator['app'].exitApp(); 
            } 
            
                this.lastTimeBackPress = new Date().getTime();
            }else {
             
        }
    });
});

}