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

Details
Android back button handling for OutSystems mobile apps, Android 16 / predictive back ready. One package that installs as a Cordova plugin (O11 MABS, older ODC builds) and as a Capacitor plugin (ODC with MABS 12), with the same JavaScript API on both.
Read more

Why this component?
From Android 16 on, apps that target API 36 no longer receive onBackPressed() or the KEYCODE_BACK key event. Predictive back is on by default. Older back button components rely on that event, so on Android 16 devices (for example a Samsung Galaxy S24 Ultra on One UI 8) your custom back logic, such as an exit confirmation, stops working without any error.

This component uses only Android’s supported API, AndroidX OnBackPressedDispatcher with OnBackPressedCallback. That is the same mechanism Cordova Android 15.1 and Capacitor use. It works on Android 7 through Android 16 and later, with both gesture and 3-button navigation.

Features

  • Per-screen control. Drop the BackButtonHandler block on a screen. It registers when the screen is ready and unregisters when you leave, so every screen controls back on its own. The most recently shown screen always wins, even during screen transitions.
  • OnBackButton event. Run your own logic on back: close a popup or panel, cancel an edit, go to a specific screen, or call TriggerDefaultBack to let the normal back happen.
  • Built-in exit confirmation. Set ShowExitConfirmation = True on your home screen and choose the message, title and button labels. Back presses during the dialog are ignored, so it never opens twice.
  • Runtime switching. Bind Enabled or ShowExitConfirmation to variables, for example “back closes the panel while it is open, otherwise ask to exit”.
  • Global master switch. DisableBackHandling and EnableBackHandling hand back to the system for the whole app, for example while a native picker or a third-party SDK screen is open.
  • Predictive back friendly. When no handler is active, the component removes its native callback completely, so the default back and Android’s predictive back animation keep working.
  • Diagnostics. GetBackButtonStatus returns availability, platform (Cordova or Capacitor), whether back is currently intercepted, the master switch state, the number of active handlers, and the wrapper version.
  • Safe everywhere. On iOS, in the browser, or in a build without the plugin, CheckBackButtonPlugin returns False and every action is a no-op. Nothing crashes and iOS builds are not affected.
  • One plugin for both native stacks: Cordova (O11 MABS, older ODC builds) and Capacitor (ODC with MABS 12).
Release notes (1.0.0)
License (1.0.0)
Reviews (0)
Team
Other assets in this category