Reopening the app from background is crashing with an exception of "Window was already created" from base.onresume().

Keerthana Krishna 40 Reputation points
2024-05-08T07:28:42.4233333+00:00

When I try to reopen an app from background it is crashing when I am using base.onresume() in mainactivity. It gave an exception "Window was already activated". I saw some work around of adding launchmode as singletop or singletask would work but in my case it didnot work. I added OnNewIntent method also to see if works, but no. I tried many ways making it to work but it didnot. Please suggest some solution for this.

Thanks in advance.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,961 questions
{count} votes