Skip to content

[Android] Shell and Page.OnBackButtonPressed() not called on root page of Shell tab (Release build) #37657

Closed

Description

@davidlilwall

Description

In 10.0.90, Shell.OnBackButtonPressed() is not called when the current page is the root page of a Shell tab on Android. This only happens in Release builds - it works fine in Debug.

Steps to Reproduce

  1. Create a Shell app with multiple tabs.
  2. Override Shell.OnBackButtonPressed() so it returns true. eg:

public partial class AppShell : Shell
{
protected override bool OnBackButtonPressed()
{
return true;
}
}

  1. Deploy a Release build to Android.
  2. Navigate to the root page of a non-home tab.
  3. Press the device Back button.

Expected
Shell.OnBackButtonPressed() is called and the event is handled.

Actual
Shell.OnBackButtonPressed() is not called.

Note that the same applies to Page.OnBackButtonPressed().

Link to public reproduction project repository

No response

Version with bug

10.0.90

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

10.0.60

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

Registering an Android OnBackPressedCallback in MainActivity appears to fix things even if the callback function does nothing except pass the call on to Android. eg.

    protected override void OnCreate(Bundle? savedInstanceState)
    {
        base.OnCreate(savedInstanceState);

        OnBackPressedDispatcher.AddCallback(
            this,
            new DummyBackPressedCallback());
    }

   private class DummyBackPressedCallback : OnBackPressedCallback
   {
        public DummyBackPressedCallback() : base(true)
        {
        }

        public override void HandleOnBackPressed()
        {
            Enabled = false;
            Platform.CurrentActivity?.OnBackPressed();
            Enabled = true;
        }
    }

Relevant log output

Activity

  1. added
    t/bug
    on Aug 19, 2026
  2. added
    area-controls-shell
    on Aug 19, 2026
  3. NafeelaNazhir commented on Aug 20, 2026

    @NafeelaNazhir
    Contributor

    This issue has been validated in Visual Studio Code 1.132.0 with .NET MAUI versions 10.0.60, 10.0.70 and 10.0.90. It can be reproduced on the Android platform from 10.0.70.

    Note: Issue reproduced in both debug and release mode in Android Api 36 pixel9.
    Issue not reproduced in both debug and release mode in Android Api 30 nexus 5X.

    Issue37657.zip

    10.0.90 version(Issue reproduced) 10.0.60 version (Issue not reproduced)
    Screen.Recording.2026-08-20.at.11.32.02.AM.mov
    Screen.Recording.2026-08-20.at.12.05.32.PM.mov
  4. added
    s/verified
    s/triaged
    i/regression
    on Aug 20, 2026
  5. added
    partner/syncfusion
    on Aug 20, 2026
  6. HarishwaranVijayakumar commented on Aug 26, 2026

    @HarishwaranVijayakumar
    Contributor

    This issue was fixed with this PR-37709. I have attached video reference below.

    37657_After.1.mp4
  7. removed
    partner/syncfusion
    on Aug 26, 2026
  8. added this to the .NET 10 SR11 milestone on Sep 3, 2026
  9. kubaflo commented on Oct 10, 2026

    @kubaflo
    Contributor

    Thank you for the report and the investigation details. We are closing this as completed: Android back-button routing now honors application Shell and Page overrides before root-navigation checks, and the contributor confirmed the reported tab-root scenario is fixed.

    Supporting evidence: #37709 (merged into inflight/current).

    This records the merged source change; it does not imply that the fix is present in every released .NET MAUI package.

    If you can still reproduce the reported behavior in a build that includes the linked change, please comment here with the exact version and reproduction details so we can reopen and investigate. The existing reproduction and discussion remain available; a new issue is not required.

  10. locked and limited conversation to collaborators on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-shelli/regressionplatform/androidregressed-in-10.0.70s/triageds/verifiedt/bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions