Back button on mobile app

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
robhathome2
Profound User
Posts: 42
Joined: Mon Jun 27, 2011 9:11 am
First Name: Rob
Last Name: Horton
Company Name: Design Group Plc
Contact:

Back button on mobile app

Post 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.
Antonio
Profound User
Posts: 82
Joined: Fri Jun 29, 2012 2:33 pm
First Name: Antonio
Last Name: Ruballos
Company Name: Profound Logic
Contact:

Re: Back button on mobile app

Post 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.
robhathome2
Profound User
Posts: 42
Joined: Mon Jun 27, 2011 9:11 am
First Name: Rob
Last Name: Horton
Company Name: Design Group Plc
Contact:

Re: Back button on mobile app

Post 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.
User avatar
Alex
Profound Logic Staff Member
Posts: 233
Joined: Fri Jan 04, 2008 12:10 pm
First Name: Alex
Last Name: Roytman
Company Name: Profound Logic Software
Contact:

Re: Back button on mobile app

Post 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.
robhathome2
Profound User
Posts: 42
Joined: Mon Jun 27, 2011 9:11 am
First Name: Rob
Last Name: Horton
Company Name: Design Group Plc
Contact:

Re: Back button on mobile app

Post by robhathome2 »

That's great Alex - works perfectly and so much easier than me having to intercept it.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests