.NET MAUI app, created a new project and added "LaunchMode = LaunchMode.SingleTask" to the MainActivity.cs attribute.(Activity is only in MainActivity.cs)
Repeatedly launching the application and deleting the app from the Task Manager will call CreateMauiApp() in MainApplication.cs.
App() in App.xaml.cs, until initialization of MainPage is executed.
However, the app is not displayed.
When the app is started after this, it is called from OnStart() in App.xaml.cs.
How can I prevent CreateMauiApp() in MainApplication.cs from being called after the app is closed?
AutoRemoveFromRecents = true
-> not worked.NoHistory = true
-> not worked.(Disappearing when it goes to the background is not what I want to do.)- App.Current.Quit() in OnDestroy(). -> not worked.(OnDestroy() is not called when I exit from the task manager.)