Step1:Create a drawable:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/darker_gray" />
<item>
<bitmap
android:gravity="center"
android:src="@drawable/img_splash" />
</item>
Code link: splash_theme_bg.xml
Step2: Create Style
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash_theme_bg</item>
</style>
Code link: styles.xml
Step3: Set style in AndroidManifest.xml
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Code link: AndroidManifest.xml
Let me know if you still get stuck anywhere.
Happy Coding!