Whitescreen when reopen a MAUI app from background when app was first opened from push message
Hi,
we have a maui blazor app and there is a strange behavior on Android.
The app receives push message from firebase.
When app is completely closed (not in background) and an incoming push message is clicked the app opens and handles the push message. But when the app goes to background after clicking back button, and then you reopen the app from background, there is a white screen.
This behavior is only when app was opened from push. When opened normally, there is no problem to reopen the app from background.
What could be helpful to answer:
Settings of MainActivity
[Activity(Theme = "@style/Maui.SplashTheme", ResizeableActivity = true, LaunchMode = LaunchMode.SingleTask, Label = "App", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
possibly important settings of the incoming push message (pendingintent) that are provided to the app:
What could be the reason and how to solve it?
var intent = new Intent(this, typeof(MainActivity));
intent.AddFlags(ActivityFlags.ClearTop);
intent.AddFlags(ActivityFlags.SingleTop);
PendingIntent? pendingIntent = null;
if (Build.VERSION.SdkInt >= BuildVersionCodes.S)
{
pendingIntent = PendingIntent.GetActivity
(this, pushCounter, intent, PendingIntentFlags.Immutable);
}
else
{
pendingIntent = PendingIntent.GetActivity(this, pushCounter, intent, PendingIntentFlags.OneShot);
}