Page 1 of 1
Back button on mobile app
Posted: Thu May 14, 2015 2:22 pm
by robhathome2
We're creating some screens to be used on mobiles as people walk around the business. I'm trying to make the back button exit the particular function it is in but all it does is close the ProfoundUI mobile app.
I've tried the below:
Code: Select all
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
document.addEventListener("backbutton", function(e) {
alert("back button!!!!");
e.preventDefault();
e.stopPropagation();
return false;
});
}
and several variants to no avail.
All Ideas welcome.
Rob.
Re: Back button on mobile app
Posted: Fri May 15, 2015 1:06 pm
by Antonio
Hello Rob,
Where are you placing this code? Inside of your Profound UI screen? Is this an application running through our mobile client, or is an application you packaged yourself using Phonegap/Cordova? I want to attempt to recreate the issue you are seeing on our end and figure out a solution from there.
Re: Back button on mobile app
Posted: Fri May 15, 2015 1:14 pm
by robhathome2
Hi Antonio
Thanks for replying. I'm creating it to run within the ProfoundUI Mobile App - Phonegap is a step too far at this moment in time.
I should add that I see the alert (momentarily) when it hits the back button function but the app closes.
Rob.
Re: Back button on mobile app
Posted: Fri May 15, 2015 2:01 pm
by Alex
The handling of the Android Back Button is built into the Profound UI Mobile Client. All, you have to do is create a button in the record format with an id of "btnBack". You can assign a response variable to this button, and then actually show it on the screen or just hide it. When the user hits the Android Back Button, it will trigger the response of your button within the application. Hope this helps.
Re: Back button on mobile app
Posted: Mon May 18, 2015 4:23 am
by robhathome2
That's great Alex - works perfectly and so much easier than me having to intercept it.