Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mikernet opened this issue Sep 27, 2024 · 0 comments
Assignees
Labels
kind/bug Something isn't working kind/regression Something was working, now it isn't platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform project/navigation-lifecycle 🧬 Categorizes an issue or PR as relevant to the navigation and lifecycle (NavigationView, AppBar, ...)

Comments

@mikernet
Copy link
Contributor

mikernet commented Sep 27, 2024

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

@mikernet mikernet added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Sep 27, 2024
@mikernet mikernet 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) Sep 28, 2024
@mikernet mikernet 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) Sep 29, 2024
@mikernet mikernet 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) Sep 29, 2024
@MartinZikmund MartinZikmund added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform kind/regression Something was working, now it isn't project/navigation-lifecycle 🧬 Categorizes an issue or PR as relevant to the navigation and lifecycle (NavigationView, AppBar, ...) and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Sep 30, 2024
@MartinZikmund MartinZikmund self-assigned this Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working kind/regression Something was working, now it isn't platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform project/navigation-lifecycle 🧬 Categorizes an issue or PR as relevant to the navigation and lifecycle (NavigationView, AppBar, ...)
Projects
None yet
Development

No branches or pull requests

2 participants