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

Keerthana Krishna 60 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.
3,722 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.