@MohanadZahed wrote:
I have successfully changed the back button behavior on Android using this code in the page’s constructor
let backAction = platform.registerBackButtonAction(() => {
let alert = this.alertCtrl.create({
message: ‘Are you sure that you want to go back?. If you go back all data will be lost’ ,
buttons: [
{
text: ‘yes’,
handler: () => {
this.navCtrl.pop();
}
},
{
text: ‘no’
}
]
});
alert.present();
},1)The problem is this code keeps triggered every time I press the back button even after going back or closing the page.
Anyone knows what the problem might be?
Posts: 1
Participants: 1