How is your experience with the OutSystems Community?
back-button
Mobile icon

Back Button

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 17 Nov (12 hours ago)
 by 
0.0
 (0 ratings)
back-button

Back Button

Documentation
1.0.0

How to use Android Back Button:-


Step 1: Add the component

  1. In Service Studio, open your mobile app.
  2. Open Manage Dependencies (Ctrl+Q) and select BackButton.
  3. Tick BackButtonHandler and any actions you need, then click Apply.

Step 2: Choose what back should do on each screen

Example A: ask “Exit app?” on the home screen

  1. Drag BackButtonHandler onto your home screen.
  2. Set ShowExitConfirmation = True.
  3. Set ExitConfirmationText = "Do you want to exit?"

Result: pressing back shows a confirmation. Exit closes the app and Cancel keeps it open.

Example B: back closes a popup instead of leaving the screen

  1. Drag BackButtonHandler onto the screen.
  2. In the OnBackButtonevent, create a handler action:
    • If the popup is open, close it.
    • Else call TriggerDefaultBack, which goes back normally.

Example C: a screen that needs nothing special
Don’t add the block. Back works as usual.

Example D: turn custom back off for a while

  • On one screen: set the block’s Enabled = False, or bind it to a variable.
  • In the whole app: call DisableBackHandling, and call EnableBackHandling to turn it back on.

Step 3: Build the app

  1. Publish the app.
  2. In Service Center, generate a new Android build and install it.

The back button only works in a new native build. In the browser, it does nothing; that is expected.

Useful actions

ActionWhat it does
CheckBackButtonPluginTells you if the plugin works on this device (True or False).
TriggerDefaultBackPerforms the normal back.
ExitAppCloses the app.
MinimizeAppSends the app to the background.
EnableBackHandling / DisableBackHandlingTurns custom back on or off for the whole app.
GetBackButtonStatusShows the current state, for debugging.

Good to know

  • One block per screen is enough. When you leave the screen, its back logic stops automatically.
  • iOS has no back button, so nothing happens there and nothing breaks.
  • “Deprecated Extensibility Configuration” warning in O11: ignore it, it’s expected.
  • “Plugin not available” on a phone: generate a new Android build and install it again.
  • Dialog title and button labels only show if your app also includes the cordova-plugin-dialogs plugin. Without it, only the message text is shown.

See the BackButtonDemo app for a working example of every feature.

.

Full documentation: https://github.com/gourav-grv/os-android-back-button