Yo tuve un problema similar y el código que me ayudó fue este: `var childViewCount = ((ViewGroup)((Activity)MainActivity.Instance).Window.DecorView).ChildCount;
var childViewCount = ((ViewGroup)((Activity)MainActivity.Instance).Window.DecorView).ChildCount;
if (Rg.Plugins.Popup.Popup.SendBackPressed())
{
await PopupNavigation.Instance.PopAsync(true);
return;
}
if (Xamarin.Forms.Application.Current.MainPage.Navigation.ModalStack.Count > 0)
{
base.OnBackPressed();
return;
}
// Check if a non modal page has been pushed, if any modal page or popups are open
if (Xamarin.Forms.Application.Current.MainPage.Navigation.NavigationStack.Count > 1 ||
childViewCount > 2)
{
base.OnBackPressed();
//await PopupNavigation.Instance.PopAsync(true);
return;
}
if (_backToExitPressedOnce)
{
base.OnBackPressed();
Java.Lang.JavaSystem.Exit(0);
return;
}
this._backToExitPressedOnce = true;
Toast.MakeText(this, "Tap again to exit", ToastLength.Short).Show();
new Handler().PostDelayed(() => { _backToExitPressedOnce = false; }, 2000);`
en el main activity del proyecto android sobreescribiendo
public async override void OnBackPressed()
yo estoy usando algunos plugins espero te sirva.