Android Back Button navigate twice back
-
Elie TodjomHas successfully completed the online course Basics (100)2 years ago #34416
Hello Simplifier Community,
i have implemented the navigate back on the Android Client but each time I press it, it navigates twice back instead on one time.
Example: I Open: HomePage –> Listpage –> DetailPage and then press the Android BackButton and the navigation leads me to HomePage instead of ListPage.I first register the Backbutton and attach a customEvent to it like this:
if (device.platform && device.platform === "Android") { document.addEventListener("backbutton", onBackButtonPress.bind(this), false); sap.ui.getCore().byId("Application").attachNavigate(function(oEvent) { this.getGlobals().setVar("gvCurrentScreen", oEvent.getParameter("toId")); }.bind(this)); } function onBackButtonPress() { this.callCustomEvent("onHardwareBackButtonPress"); }
Later on the onHardwareBackButtonPress CustomEvent will call navContainerNavigation from SF_HELPER with this code:
this.getView().byId(oPayload.navContainerId).to(this.getView().getId()+"--"+oPayload.navigationGoalId); fnSuccess();
But the navigation always happen twice.
Jennifer HäfnerHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)Has successfully completed the Intermediate CertificationHas successfully completed the Advanced Certification2 years ago #34435::Hi Elie,
You can check if the function ‘onBackButtonPress’ (and therefore, the custom event ‘onHardwareBackButtonPress’) is really executed twice everytime the back button is pressed, or if the issue is that the navigationGoalId contains the wrong screen name.
This information is helpful to find the cause of this issue.
Elie TodjomHas successfully completed the online course Basics (100)Elie TodjomHas successfully completed the online course Basics (100)2 years ago #34533::Hello Jennifer,
the onBackButtonPress itself is executed once but the backTo() Methode Twice. The StackPage is clear Twice and is really executed twice and I can see it on my device Screen. It first goBack to the previous page and go Back once again.
I did a screen Shot of the call stack , form the moment the ‘onHardwareBackButtonPress’ is call.
Thank you.
Attachments:
You must be logged in to view attached files.Jennifer HäfnerHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)Has successfully completed the Intermediate CertificationHas successfully completed the Advanced Certification
You must be logged in to reply to this topic.