Duplicate custom SplashScreen in multiple activity application on Android 12

Viewed 260

My SplashScreen have different icon to the app icon. My app have many activities, so I need to call installSplashScreen() for each activity. I using Androidx SplashScreen compat library (1.0.0-alpha01) follow this document.
After doing this, every time I open application, the Splash screen will display twice, one for SplashActivity and one for MainActivity, also for other activity.

I can use installSplashScreen() for SplashActivity only but it only work well in cold start. In warm start, the application will show the default SplashScreen (app icon) instead of my custom SplashScreen.

I want a SplashScreen which have a same display behaviour like default SplashScreen, just different icon and background. From the document, I found this but I don't know how to do

You can use the SplashScreen API directly, but we strongly recommend using the Androidx SplashScreen compat library instead

Is possible to achieve this by use SplashScreen API directly?

2 Answers

My experience is that you need to call installSplashScreen() all on activities. I doubt that its the intended behavior but I havent found any other way.

Related