Fuse Community

Prevent BackButton Android

Heey :smiley:
Is it Possible to prevent the system from going back when pressed the Hardware-Back-Button on Android?

I know, that I can start a Trigger on that like this:

 <OnBackButton>
          <Callback Handler="{onBackButtonPressed}" />
 </OnBackButton>

But it first makes “router.goBack()” and then my function: “onBackButtonPressed”.
I only want to fire my function and prevent the user from going back…

Could anyone help? :slight_smile:
Thanks! (=

I got a solution:
I changed this

<Router ux:Name="router" BackButtonAction="None"/>
So that there is no action onBackPressed … And then in my function “onBackButtonPressed” I take a look wich page I am and then router.goBack() or not :smiley:

Chears!

1 Like

Good job @Georg! :+1: