Skip to main content

Control Android Back Button

Control Android Back Button

Use this component to control the android physical back button, and to pass your own custom action which will run when users press the back button on their device.


To get started using it you must use KmpBackButton.

Enable/Disable the Back button

To toggle the back button ON/OFF, use these functions:


_3
KmpBackButton.enableBackButton()
_3
_3
KmpBackButton.disableBackButton()

Override the back button with Custom Action

To provide your own custom action to invoke when users press the back button, please use this function:


_5
KmpBackButton.disableBackButtonOverrideWithCustomAction {
_5
_5
// my custom action which will be invoked each time the user presses the back button on their device
_5
_5
}

Any Required Setup?

None