Skip to content

[Android] LaunchMode.SingleTask in MainActivity causes blank UI on relaunch (Uno 5.4 regression) #18325

Closed

Description

@mikernet

Current behavior

Starting with 5.4.x, when MainActivity is set to LaunchMode.SingleTask, the app shows a blank UI if it is running persistently in the background (i.e. because it is receiving background location updates) and it is closed/swiped away and then relaunched:

Screen_Recording_20240927_134515_Volt.mp4

Expected behavior

Same as version <= 5.3.x - app UI should restore to its previous state and show properly again after relaunch:

Screen_Recording_20240927_133913_Volt.mp4

How to reproduce it (as minimally and precisely as possible)

[Activity(
    MainLauncher = true,
    LaunchMode = LaunchMode.SingleTask,
    ...)]
public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity

Then run something that will keep the activity alive like a background service or background location updates, swipe away the app, then click the icon to launch it again and reactivate the activity and notice you get a blank screen.

Repro project would require large amounts of actual app code that contains all the permission request logic/UI, background location update service, etc...so if you want that then I will need to send the code privately as I can't share it publicly.

Workaround

None

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

5.4.5, 5.5.0-dev-66

Affected platforms

Android

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Activity

  1. added
    difficulty/tbd
    kind/bug
    triage/untriaged
    on Sep 27, 2024
  2. changed the title [-][Android] LaunchMode.SingleTask in MainActivity causes app to hang on relaunch (starting with Uno 5.4)[/-] [+][Android] LaunchMode.SingleTask in MainActivity causes app to hang on relaunch (Uno 5.4 regression)[/+] on Sep 28, 2024
  3. changed the title [-][Android] LaunchMode.SingleTask in MainActivity causes app to hang on relaunch (Uno 5.4 regression)[/-] [+][Android] LaunchMode.SingleTask in MainActivity causes blank UI relaunch (Uno 5.4 regression)[/+] on Sep 29, 2024
  4. changed the title [-][Android] LaunchMode.SingleTask in MainActivity causes blank UI relaunch (Uno 5.4 regression)[/-] [+][Android] LaunchMode.SingleTask in MainActivity causes blank UI on relaunch (Uno 5.4 regression)[/+] on Sep 29, 2024
  5. added
    platform/android 🤖
    kind/regression
    project/navigation-lifecycle 🧬
    and removed
    triage/untriaged
    difficulty/tbd
    on Sep 30, 2024
  6. agneszitte commented on Oct 4, 2024

    @agneszitte
    Member

    @jeromelaban, @MartinZikmund is additional QA needed for this issue?

  7. jeromelaban commented on Oct 5, 2024

    @jeromelaban
    Member

    Yes, this is needed.

  8. MartinZikmund commented on Oct 7, 2024

    @MartinZikmund
    Member

    @jeromelaban, @MartinZikmund is additional QA needed for this issue?

    Created a manual test sample in the Samples app under Windowing category

  9. agneszitte commented on Jan 15, 2025

    @agneszitte
    Member

    @jhanvi03, @Darsh0307 if you can test this with latest stable version, please

  10. github-actions commented on May 7, 2026

    @github-actions
    Contributor

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests.

  11. locked as resolved and limited conversation to collaborators on May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

kind/bugkind/regressionplatform/android 🤖project/navigation-lifecycle 🧬

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions