Skip to content

Android: BackButton on Android 16 not working after command from FlyOutPage #33508

@3sRykaert

Description

@3sRykaert

Description

After browsing to a page by a command on the FlyoutPage, the back button ain't working anymore.
This only happens on Android 16 (API 36) and does NOT occur on Android 14 (API 34) so it might have something to do with: predictive-back-gesture https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture#update-custom

OK by using Button on DetailPage NOT OK by using Button on FlyOutPage
Image Image

Steps to Reproduce

OK Scenario:

  1. Open the sample app from https://github.com/3sRykaert/MauiMemoryleak/tree/BackButtonNotWorking
  2. Click the button to go to the "DetailPage1" on "StartPage"
  3. Press the Android Back Button
  4. A PopUp appears to show you have pressed the BackButton (which is ok)
  5. Click the button to go to the "StartPage" on "DetailPage1"
  6. Click the button to go to the "DetailPage1" on "StartPage" (same as step 2)
  7. Press the Android Back Button (same as step 3)
  8. A PopUp appears to show you have pressed the BackButton (which is ok)

NOT OK Scenario

  1. Open the sample app from https://github.com/3sRykaert/MauiMemoryleak/tree/BackButtonNotWorking
  2. Click the button to go to the "DetailPage1" on "StartPage"
  3. Press the Android Back Button
  4. A PopUp appears to show you have pressed the BackButton (which is ok)
  5. Open the "FlyOut Page" and there press the button to go the "StartPage"
  6. Click the button to go to the "DetailPage1" on "StartPage" (same as step 2)
  7. Press the Android Back Button (same as step 3)
  8. NO PopUp appears to show you have pressed the BackButton (which is not ok) (also breakpoint in protected override bool OnBackButtonPressed() on MasterPage.xaml.cs does not hit)

Link to public reproduction project repository

https://github.com/3sRykaert/MauiMemoryleak/tree/BackButtonNotWorking (so repo: https://github.com/3sRykaert/MauiMemoryleak/ but branch BackButtonNotWorking)

Version with bug

10.0.20

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Only tested on Android (14 is not impacted, 16 is)

Did you find any workaround?

No

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions