Duplicate OnCreate on startup when theme is selected
Inrego opened this issue ยท 1 comments
Inrego commented
๐ Bug Report
When a theme is selected, MainActivity.OnCreate is called twice upon startup. That results in 2x initialization, and end result is that the RootPage will show a back button, which when tapped, goes back to an empty tab page.
Expected behavior
Don't initialize app twice when a theme is selected.
Reproduction steps
- Select a different theme than "Auto"
- Close app (properly)
- Open app again.
3.a. Back button should now be showing - Tap back button
- Now you're stuck on an empty tab page, without being able to navigate further in the app. You have to close it and reopen.
Configuration
I only tested Android. Might be an issue on other platforms too.
Platform:
- ๐ฑ iOS
- ๐ค Android
- ๐ WPF
- ๐ UWP
- ๐ MacOS
- ๐บ tvOS
- ๐ Xamarin.Forms
Inrego commented
I do believe it's the Activity.Recreate()
in ThemeService
.
I tried commenting out the following lines, and the issue disappeared (it's not a fix, I know, but locates the problem).
Chameleon/Chameleon.Droid/ThemeService.cs
Lines 66 to 70 in fb19460