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

Override Back button behaviour WITHOUT stopping navigation

$
0
0

So what I'm trying to do might not be possible, but maybe someone knows a nifty hack or work-a-round...

What I'd like to do is override the Android Back button so that instead of destroying the activity, it sends it to the background with the "MoveTaskToBack()" function.

Seems simple enough BUT...

I'd like to leave the navigation behaviour alone as well as any other handling of the back button (i.e. On a Tabbed page, the back button changes the page to one index back). The problem as the event used to invoke the changes in Xamarin.Forms is located in the base class AppCompatActivity, and there is no function call to raise this event.

So if I override the OnBackPressed I lose the ability to let Xamarin.Forms handle back events, but if I don't override it then I get an undesirable behaviour when Forms is done handling the back button.


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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