Closed RobertHassfeld closed 3 months ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Further information. The CreateWindow function does not work because OnCreate is called with bundle = null and then CreateWindow is triggered. All necessary information is available in the CreateWindow method, but then the OnCreate method throws this exception and all information in the Intent is removed.
See this PR: Add better exception if user opens second activity
you need to remove this line
https://github.com/RobertHassfeld/AppFlip/blob/main/AppFlip/App.xaml.cs#L9
and instantiate your window inside createwindow
return new Window(new AppShell())
Thank you for the solution. It works in my test project. Unfortunately, it has a big impact on our project. So we have to change the whole initialization process of the app.
Description
We used an OAuth-based App Flip linking to connect to GoogleHome in our App. account-linking/app-flip-overview
Maybe this issue is related to: MAUI Android build crashes when app is reopened from background. It throws the exception: 'Window was already created.
Add better exception if user opens second activity
Steps to Reproduce
Perform the following steps for testing:
Link to public reproduction project repository
https://github.com/RobertHassfeld/AppFlip/tree/main
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 12, 13, 14
Did you find any workaround?
No workaround found.
Relevant log output