Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

In Android applications, it is very common for users to use the physical back button on the device itself, instead of a back button on the screen.

PhoneGap uses an event listener called "backbutton" to catch when a user presses the Android back button. The prepackaged PhoneGap Android project in Profound UI already handles this event and looks for the app to handle it in the Rich Display File simply by including a button with the id of "btnBack".  The button can be hidden on the screen if desired.

The button can have a JavaScript onclick action or a bound response property.  For example, if you bind the response property to a named RPG indicator that is also called btnBack, the RPG code to handle the back button would look as follows:

If btnBack = *On;
  // handle back button response using RPG here
EndIf;

If a button with the id of "btnBack" is not defined on your screen, the application simply exits when the user presses the back button on the device.

Note that you can change the default "backbutton" event listener, if required, by modifying the app.js file in your project.

  • No labels