Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Splash Screen API not showing icon on Android lollipop 5.0 and 5.1

I am using splash screen API , everything is working fine but it doesn't show icon on android 5.0 and 5.1.

SplashScreen API Version

implementation 'androidx.core:core-splashscreen:1.0.0'

Theme.xml

<style name="Theme.Splash" parent="Theme.SplashScreen.IconBackground">
        <item name="postSplashScreenTheme">@style/Theme.MyTheme</item>
</style>

MainActivity.kt

val splashScreen = installSplashScreen()

Manifest.xml

<application
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:name=".CarApplication"
        android:theme="@style/Theme.Splash"
        tools:targetApi="31">
        <activity
            android:theme="@style/Theme.Splash"
            android:name=".presentation.MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
 </application>

Android Version 11

enter image description here

Android Version 5.0

enter image description here

Now all I need to do is show the icon on devices with android 5.0 as well. I did everything in the documentation but it doesn't seems to work with android 5.0

like image 716
U. Manzoor Avatar asked Oct 19 '25 15:10

U. Manzoor


1 Answers

Just found out after hours digging on the lib code :))). There is a comment on androidx.core.splashscreen.SplashScreen class:

On API 21-22, The icon isn't displayed until the application starts, only the background is visible.

Known incompatibilities: https://developer.android.com/reference/kotlin/androidx/core/splashscreen/SplashScreen

like image 133
Rifqi Mulya Fahmi Avatar answered Oct 21 '25 05:10

Rifqi Mulya Fahmi