Ionic Framework v4.0 Hardware back button is not working?Disable hardware back button in Ionic application?Control hardware back button in ionic frameworkXHR error (404 Not Found) loading http://localhost:3000/traceurIonic 2 prevent hardware back button defaultNativescript Back Button not redirecting to the correct pageIonic 3 navcontroller pop twice with modal got not consistent historyHow to stop ActivatedRoute.queryParams.subscribe to be called on back navigation?ionic native-serial returns device not foundAngular routerDirection “forward”How To Redirect Hardware Back Button in Ionic 3?

Copycat chess is back

Why has Russell's definition of numbers using equivalence classes been finally abandoned? ( If it has actually been abandoned).

How to re-create Edward Weson's Pepper No. 30?

How does one intimidate enemies without having the capacity for violence?

N.B. ligature in Latex

Is it tax fraud for an individual to declare non-taxable revenue as taxable income? (US tax laws)

How to report a triplet of septets in NMR tabulation?

How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?

What is the offset in a seaplane's hull?

The use of multiple foreign keys on same column in SQL Server

Draw simple lines in Inkscape

Why Is Death Allowed In the Matrix?

If Manufacturer spice model and Datasheet give different values which should I use?

What defenses are there against being summoned by the Gate spell?

How to type dʒ symbol (IPA) on Mac?

Email Account under attack (really) - anything I can do?

Are tax years 2016 & 2017 back taxes deductible for tax year 2018?

How is it possible to have an ability score that is less than 3?

A Journey Through Space and Time

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)

declaring a variable twice in IIFE

Continuity at a point in terms of closure

How can I fix this gap between bookcases I made?

Do Phineas and Ferb ever actually get busted in real time?



Ionic Framework v4.0 Hardware back button is not working?


Disable hardware back button in Ionic application?Control hardware back button in ionic frameworkXHR error (404 Not Found) loading http://localhost:3000/traceurIonic 2 prevent hardware back button defaultNativescript Back Button not redirecting to the correct pageIonic 3 navcontroller pop twice with modal got not consistent historyHow to stop ActivatedRoute.queryParams.subscribe to be called on back navigation?ionic native-serial returns device not foundAngular routerDirection “forward”How To Redirect Hardware Back Button in Ionic 3?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















We are not able to perform the back button events, Ionic with angular on Android Platform.



When i hit multiple time on back button, we are getting multiple times of alertboxes comes out.



How do we perform backbutton on specific pages with particular alertboxes, and when i clicked back button existing alertbox or menu controller dismissed.



Please look at to code applied. app.component.ts



Thanks



import Component,ViewChildren,QueryList from '@angular/core';
import Platform from '@ionic/angular';
import MenuController, NavController,LoadingController,IonRouterOutlet from '@ionic/angular';
import ToastController,ModalController,AlertController from '@ionic/angular';
import Router from '@angular/router';

export class AppComponent {

@ViewChildren(IonRouterOutlet) routerOutlets: QueryList < IonRouterOutlet > ;
ngOnInit()
this.backButtonHandler()

backButtonHandler()
this.platform.backButton.subscribeWithPriority(99999, async() =>
// close action sheet
// this.alertBook.dismiss();
try
const element = await this.alertCtrl.getTop();
if (element)
element.dismiss();
return;

catch (error)

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



catch (error)


this.routerOutlets.forEach((outlet: IonRouterOutlet) =>
if (outlet && outlet.canGoBack())
outlet.pop();

else if (this.router.url === '/home')
console.log("trigger home");
this.createAlert();
else if (this.router.url === '/contact')
console.log("trigger contact");
this.contactAlert();

);
);










share|improve this question






















  • hello do you find solution, same problem here

    – LaurentY
    Mar 19 at 17:30

















0















We are not able to perform the back button events, Ionic with angular on Android Platform.



When i hit multiple time on back button, we are getting multiple times of alertboxes comes out.



How do we perform backbutton on specific pages with particular alertboxes, and when i clicked back button existing alertbox or menu controller dismissed.



Please look at to code applied. app.component.ts



Thanks



import Component,ViewChildren,QueryList from '@angular/core';
import Platform from '@ionic/angular';
import MenuController, NavController,LoadingController,IonRouterOutlet from '@ionic/angular';
import ToastController,ModalController,AlertController from '@ionic/angular';
import Router from '@angular/router';

export class AppComponent {

@ViewChildren(IonRouterOutlet) routerOutlets: QueryList < IonRouterOutlet > ;
ngOnInit()
this.backButtonHandler()

backButtonHandler()
this.platform.backButton.subscribeWithPriority(99999, async() =>
// close action sheet
// this.alertBook.dismiss();
try
const element = await this.alertCtrl.getTop();
if (element)
element.dismiss();
return;

catch (error)

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



catch (error)


this.routerOutlets.forEach((outlet: IonRouterOutlet) =>
if (outlet && outlet.canGoBack())
outlet.pop();

else if (this.router.url === '/home')
console.log("trigger home");
this.createAlert();
else if (this.router.url === '/contact')
console.log("trigger contact");
this.contactAlert();

);
);










share|improve this question






















  • hello do you find solution, same problem here

    – LaurentY
    Mar 19 at 17:30













0












0








0








We are not able to perform the back button events, Ionic with angular on Android Platform.



When i hit multiple time on back button, we are getting multiple times of alertboxes comes out.



How do we perform backbutton on specific pages with particular alertboxes, and when i clicked back button existing alertbox or menu controller dismissed.



Please look at to code applied. app.component.ts



Thanks



import Component,ViewChildren,QueryList from '@angular/core';
import Platform from '@ionic/angular';
import MenuController, NavController,LoadingController,IonRouterOutlet from '@ionic/angular';
import ToastController,ModalController,AlertController from '@ionic/angular';
import Router from '@angular/router';

export class AppComponent {

@ViewChildren(IonRouterOutlet) routerOutlets: QueryList < IonRouterOutlet > ;
ngOnInit()
this.backButtonHandler()

backButtonHandler()
this.platform.backButton.subscribeWithPriority(99999, async() =>
// close action sheet
// this.alertBook.dismiss();
try
const element = await this.alertCtrl.getTop();
if (element)
element.dismiss();
return;

catch (error)

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



catch (error)


this.routerOutlets.forEach((outlet: IonRouterOutlet) =>
if (outlet && outlet.canGoBack())
outlet.pop();

else if (this.router.url === '/home')
console.log("trigger home");
this.createAlert();
else if (this.router.url === '/contact')
console.log("trigger contact");
this.contactAlert();

);
);










share|improve this question














We are not able to perform the back button events, Ionic with angular on Android Platform.



When i hit multiple time on back button, we are getting multiple times of alertboxes comes out.



How do we perform backbutton on specific pages with particular alertboxes, and when i clicked back button existing alertbox or menu controller dismissed.



Please look at to code applied. app.component.ts



Thanks



import Component,ViewChildren,QueryList from '@angular/core';
import Platform from '@ionic/angular';
import MenuController, NavController,LoadingController,IonRouterOutlet from '@ionic/angular';
import ToastController,ModalController,AlertController from '@ionic/angular';
import Router from '@angular/router';

export class AppComponent {

@ViewChildren(IonRouterOutlet) routerOutlets: QueryList < IonRouterOutlet > ;
ngOnInit()
this.backButtonHandler()

backButtonHandler()
this.platform.backButton.subscribeWithPriority(99999, async() =>
// close action sheet
// this.alertBook.dismiss();
try
const element = await this.alertCtrl.getTop();
if (element)
element.dismiss();
return;

catch (error)

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



catch (error)


this.routerOutlets.forEach((outlet: IonRouterOutlet) =>
if (outlet && outlet.canGoBack())
outlet.pop();

else if (this.router.url === '/home')
console.log("trigger home");
this.createAlert();
else if (this.router.url === '/contact')
console.log("trigger contact");
this.contactAlert();

);
);







angular ionic-framework ionic-native






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 8 at 5:37









PPSPPS

1961319




1961319












  • hello do you find solution, same problem here

    – LaurentY
    Mar 19 at 17:30

















  • hello do you find solution, same problem here

    – LaurentY
    Mar 19 at 17:30
















hello do you find solution, same problem here

– LaurentY
Mar 19 at 17:30





hello do you find solution, same problem here

– LaurentY
Mar 19 at 17:30












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55057310%2fionic-framework-v4-0-hardware-back-button-is-not-working%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55057310%2fionic-framework-v4-0-hardware-back-button-is-not-working%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

Алба-Юлія

Захаров Федір Захарович