Bajra Help

Welcome!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

3

How to solve the Android 12+ Splash Screen issue?

Avatar
Sumnima Sherchan

After upgrading Ionic Apps to Capacitor 4, Android 12+ apps do not show the old splash screen. From what I've researched, the new Android Splash Screen API now uses the App Icon as the splash screen with the option to customize the background, color, animation etc. Current possible solutions are to either go with the icon, or manually customize the old splash screen. Are there other better solutions for this? 

Avatar
Discard
1 Answer
4
Avatar
Prabin Bhusal
Best Answer

Starting on Android 12, default Splash Screen is constructed using the app's default launcher icon with the background attribute. If you're building the splash screen by overriding the theme as android:background, you may experience some unintended results on Android 12  & higher.  

Since Android has launched the new Splash Screen API which is backward compatible with previous android versions, migrating the old splash screen will be the best approach to solve this issue.

On android 12 & higher,  android:background attribute doesn't works. It will show the app icon instead of the splash screen background.

You can change the icon by adding into the splash screen theme as:

<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
   <item name="windowSplashScreenBackground">@color/...</item>
   <item name="windowSplashScreenAnimatedIcon">@drawable/...</item>
   <item name="postSplashScreenTheme">@style/Theme.App</item>

...
</style>

You don't have to worry about the name windowSplashScreenAnimatedIcon, it will use your static icon if you don't provide the animated vector icon (avd).

Don't forget to replace the application theme with SplashScreen Theme under manifest.

If you still face the problem, please post a full code of your splash screen theme implementation .


Avatar
Discard

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!