I've implemented the new Android Splash Screen API with a RoutingActivity
since it isn't feasible for my app to break it down to a single activity application. The recommended way, as per the developer docs is as below:
class RoutingActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
val splashScreen = installSplashScreen()
super.onCreate(savedInstanceState)
// Keep the splash screen visible for this Activity
splashScreen.setKeepOnScreenCondition { true }
startSomeNextActivity()
finish()
}
This seems to work well on some devices but with others, it stays on for over 8-12secs sometimes. I added a log with a timer after on create just to see when execution occurs. It was reached after 5secs.
Is there something that can be done to make the splash screen complete much faster?