I’m trying to change the background color of splash screen using the splash screen API but idk why it’s not working.
Tested on Android Studio Emulator (API 34) and my Samsung mobile (API 33).
themes.xml
<style name="Theme.MyApp" parent="android:Theme.Material.Light.NoActionBar" />
<style name="Theme.Splash" parent="Theme.SplashScreen">
<item name="windowSplashScreenIconBackgroundColor">@color/black</item>
<item name="postSplashScreenTheme">@style/Theme.MyApp</item>
</style>
MainActivity.kt
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val splashScreen = installSplashScreen()
setContent {
// rest of code
}
}
AndroidManifest.xml
<application
...
android:theme="@style/Theme.Splash"
...
</application>