Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Prevent Modal being closed with Android Hardware button

$
0
0

Hello everyone,

as stated in the title I would like to prevent the Android Hardware Back button to close a specific modal on the navigation stack.

The modal get's called like:

await Navigation.PushModalAsync(Page, true);

I've tried using

protected override bool OnBackButtonPressed ()

In the Page but it doesn't seem to fire.

I've tried using

public override void OnBackPressed ()

In the MainActivity but I can't find a way to get the currently open modal and prevent it from being popped.

I've been cruising on google / stackoverflow and these forums but I cannot make any of the examples work.

Any help or pointers are greatly appreciated.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>