Status Update
Comments
ba...@google.com <ba...@google.com> #2
Android build
Which Android build are you using? (e.g. PPP5.180610.010)
Device used -- Device Make, Model, Android OS Version
Which device did you use to reproduce this issue?
Please provide a sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Android bug report (to be captured after reproducing the issue)
For steps to capture a bug report, please refer:
Note: Please avoid uploading directly to the issue using attachments. Please upload to google drive and share the folder to android-bugreport@google.com, then share the link here.
sa...@google.com <sa...@google.com> #3
[Deleted User] <[Deleted User]> #4
I saw the same issue and fixed it the same way through this suggestion and the one in AppCompatActivity
. We were able to replicate the crash reports by turning on "Don't keep activities" and backgrounding and reopening the app.
In the other issue, a Google representative replied that is the intended behavior. Given it is intended, it would be helpful to include a note about this in the documentation:
ba...@google.com <ba...@google.com> #5
ra...@google.com <ra...@google.com>
vi...@google.com <vi...@google.com> #6
Thank you for your feedback. We assure you that we are doing our best to address all issues reported. For now, we will be closing the issue as won't fix obsolete. If this issue currently still exists, we request that you log a new issue along with the bug report here
Description
URL:https://developer.android.com/guide/topics/ui/splash-screen/migrate#migrate_your_splash_screen_implementation
Go to step 4 where it states
Call installSplashScreen in the starting activity before calling setContentView.
.The snippet actually has an issue that I got a few crash reports for. It happens if you are using Fragments and an AppCompat theme.
After a config change occurs, the Fragments are restored when
super.onCreate(savedInstanceState)
is called.That
val splashScreen = installSplashScreen()
call is responsible for changing the theme over. TheTheme.SplashScreen
does not have a value forR.styleable.AppCompatTheme_windowActionBar
so when the Fragment restores, you get a crash"You need to use a Theme.AppCompat theme (or descendant) with this activity.");
.The fix I did was the following code
By moving the install call above
super
the theme changes before the Fragments are restored. It could be worth mentioning this in the documentation perhaps but it is subjective since you need to use an AppCompat theme / Fragments.